Hi!
Is the following a known bug in Xerces 2.5.0 and 2.6.0?
 
There is no validation when I use InputSource to give the XML to the parser and set the property for the external schema.
Only well-formedness is checked.
However if I pass the XML with a filename it works fine.
 
Example:
String data = ""
DOMParser parser = new DOMParser();
parser.setFeature(XercesConst.DYNAMIC_VALIDATION_FEATURE_ID, true);
parser.setFeature(XercesConst.SCHEMA_VALIDATION_FEATURE_ID, true);
parser.setProperty("http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation", "c:/path/file.xsd");
Reader reader = new StringReader(data);
InputSource src = "" InputSource(reader);
parser.parse(src);
This example does not do validation with the specified file.
 
If I set the SystemId of the InputSource to any value, like this:
src.setSystemId("bla");
 
The validation does happen!
 
Is it a bug or feature that I don't understand?
 
Robert.
 

Reply via email to