Hi,
I am running Xerces 2.6.2 under Tomcat 5.0.28. I get the XML
document from an InputSource, I set the validation features, but I don’t
get any error for an XML document that is not schema-compliant. I included my
code below. Any help would be greatly appreciated.
Thank you,
Ugo
xmlStream = new StringReader(Waybill);
InputSource xmlSource = new InputSource(xmlStream);
xmlSource.setSystemId("xmlSource");
// create DOM document from Waybill input string using
Xerces 2.6.2
DOMParser parser = new
DOMParser();
// set parser features and
properties
parser.setFeature(NAMESPACES_FEATURE_ID, true);
parser.setFeature(VALIDATION_FEATURE_ID, true);
parser.setFeature(SCHEMA_VALIDATION_FEATURE_ID, true);
parser.setFeature(SCHEMA_FULL_CHECKING_FEATURE_ID,true);
parser.setFeature(DYNAMIC_VALIDATION_FEATURE_ID, true);
parser.setFeature(AUGMENT_PSVI_FEATURE_ID, true);
parser.setProperty(NONAMESPACESCHEMALOCATION_PROPERTY_ID,
“c:/…”);
// create DOM document
parser.parse(xmlSource);