@Override public LSInput resolveResource( String type, String namespaceURI, String publicId, String systemId, String baseURI) { // give the entity resolver an opportunity (mostly to throw an exception) try { InputSource is = entityResolver.resolveEntity(publicId, systemId); if (is != null) { return new InputSourceToLSResource(is); } } catch (SAXException | IOException e) { throw new RuntimeException(e); } // otherwise fall back on the default resolution path return delegate.resolveResource(type, namespaceURI, publicId, systemId, baseURI); } }