SchemaFactory sf = XmlFactory.createSchemaFactory(W3C_XML_SCHEMA_NS_URI, disableXmlSecurity);
XmlFactory.allowExternalAccess(sf, "all", disableXmlSecurity);
sf.setErrorHandler(errorFilter);
if( entityResolver != null ) {
sf.setResourceResolver(new LSResourceResolver() {
public LSInput resolveResource(String type, String namespaceURI, String publicId, String systemId, String baseURI) {
try {
// XSOM passes the namespace URI to the publicID parameter.
// we do the same here .
InputSource is = entityResolver.resolveEntity(namespaceURI, systemId);