I am sure that I am not the first to encounter this conflict. The code that I have inherited does the following:
org.w3c.dom.Document dom; // declaration javax.xml.validation.Schema schema; // declaration ... ... ... javax.xml.validation.Validator validator = schema.newValidator(); validator.validate(new DOMSource(dom));
I want to create a SAXParser which validates, but it seems the only way is either to create an XMLReader and use setErrorHandler() or let the ContentHandler in SAXParser.parse() also implement ...
SAXParser
XMLReader
setErrorHandler()
ContentHandler
SAXParser.parse()