}
public void doSAXParseValidate (Reader source){
SAXParser parser = null;
XMLReader reader = null;
MyURIResolver resolver = null;
try{
_output.addLine("Validating (SAX)");
SAXParserFactory factory = null;
try {
factory = getParserFactory ();
} catch (Exception ex) {
_output.addLine("Error instantiating - " + ex.getMessage());
}
factory.setValidating (_validating);
factory.setNamespaceAware (true);
parser = factory.newSAXParser ();
reader = parser.getXMLReader();
try {
reader.setFeature("http://xml.org/sax/features/validation", true);
reader.setFeature("http://apache.org/xml/features/validation/dynamic", true);
reader.setFeature("http://apache.org/xml/features/validation/schema", true);
reader.setFeature("http://apache.org/xml/features/continue-after-fatal-error", true);
// reader.setFeature("http://apache.org/xml/features/validation/schema-full-checking", true);
} catch (SAXNotRecognizedException snrec) {
System.out.println ("XMLUtility::doSAXParseValidate: " + snrec);
}
resolver = new MyURIResolver ();
resolver.addLookup(_lookuppath);
reader.setEntityResolver(resolver);
reader.setErrorHandler(new MyErrorListener(_output));
_output.addLine("Parsing input.");
reader.parse (new org.xml.sax.InputSource(source));
_output.addLine("Finished validating.");