Affects Version/s: 1.0-GA
Fix Version/s: 1.0-SR1
When trying to validate an XML document which is not well-formed, the validator returns ABORTED instead of FAILED.
Anne-Gaelle Berge logged work - 30/Aug/10 3:53 PM - edited
- Time Spent:
- 2 hours
Actually, the issue was that if the XML document is not well-formed because of a namespace (and not a mismatch tag) it is said as well-formed by the SAXParser. By default, this parser does not check the namespace and the XInclude. Consequently, some non well-formed documents are validated against an XSD and a schematron which causes the system to crash and to report an ABORTED validation.
To fix the issue, the factory for checking that the document is well-formed is configured as follows:
SAXParserFactory spfactory = SAXParserFactory.newInstance();
If the document is not well-formed, the validation ends and returns FAILED.
If a document is not valid regarding the XSD schema(s) defined for the selected schematron, the validation results is set to FAILED but the validation against the schematron is done and the results reported.
Perform some tests