I have been working to incorporate MSV in code to perform a simple function: determining that a given XML Schema document is both well-formed and conforming to the W3C recommendation. I need to report the message, line number, and column number for any and all errors. I wish to emphasize as well that in this case I have no need for validating XML instance documents against schemas.
The following is representative of the code I am using:
try {
factory = VerifierFactory.newInstance("http://www.w3.org/2001/XMLSchema" );
factory.newVerifier(schemaURL);
}
catch(SAXParseException e) {
errors.add(e); //errors is a Collection
}
catch(Exception e) {
//Do something
}
With this code, multiple errors are not being captured--just the first one. Is there a more effective and complete way for testing an XML Schema document for well-formedness and validity?
Thank you very much for any help you can provide.
-
MSV Fail-Fast Mechanism (0 messages)
- Posted by: Neil Chaudhuri
- Posted on: February 10 2004 10:40 EST