I've tried creating a SAXParser, but any xsi:schemaLocation attributes in the instance document are ignored. Does Xerces not support this feature when using JAXP?
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
...
SAXParserFactory spf = SAXParserFactory.newInstance();
spf.setSchema(schema); // schema already created beforehand
spf.setNamespaceAware(true);
SAXParser sp = spf.newSAXParser();
XMLReader parser = sp.getXMLReader();
parser.setEntityResolver( new DefaultResolver()); // the entity resolver never gets invoked
parser.setErrorHandler(new SAXErrorHandler());
parser.setContentHandler(new TestHandler());
parser.parse(new InputSource(new FileInputStream(dataPath.toFile())));
So everything works in terms of parsing and validating the document, except when there are xsi:schemaLocation attributes, these are completely getting ignored.
If I use Xerces directly, it will invoke its entity resolver.