Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » PHP Development Tools (PDT) » Custom Validation Issues
Custom Validation Issues [message #891817] Tue, 26 June 2012 06:51 Go to next message
rohit chawla is currently offline rohit chawlaFriend
Messages: 19
Registered: June 2012
Junior Member
Hi guys,

I want to validate a document, with an custom validator. Want to validate it with a xsd, but only aftter certain preprocessing of main document.
Custom validator is required instead of normal xml validator, because the schema location is not defined in the main file & also I want to do some preprocessing to the file, before applying xsd validation.

My plugin.xml is as follows:

<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>



public class CustomValidator implements ISourceValidator, IValidator {
XMLValidator validator = new XMLValidator();
IDocument document;

public void validate(IValidationContext helper, IReporter reporter) {
String fileContent = this.document.get();
final InputStream is = new ByteArrayInputStream(fileContent.toLowerCase().getBytes());
XMLValidationReport report = validator.validate("/home/rchawla/xmlWorkspace/abc.xsd", is);
ValidationMessage[] messages = report.getValidationMessages();
for(ValidationMessage message:messages){

The problem is that the execution point does come to the above validate method, but
How can I associate xsd to the xmlvalidator object and validate it. Write now, ValidationMessage[] messages = report.getValidationMessages(); is giving zero messages, even though the there are errors in the main file.
Re: Custom Validation Issues [message #891850 is a reply to message #891817] Tue, 26 June 2012 09:38 Go to previous message
Toshihiro Izumi is currently offline Toshihiro IzumiFriend
Messages: 360
Registered: July 2009
Location: Japan
Senior Member
You're in the wrong forum. Your problem is covered at WTP forum.
Previous Topic:An internal error occurred during: "Processing Dirty Regions". Java heap space
Next Topic:Fatal Error Launching Zend Debugger Eclipse 3.0.2
Goto Forum:

Current Time: Wed Feb 08 14:54:06 GMT 2023

Powered by FUDForum. Page generated in 0.01857 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top