private InputSource resolveResourceFromRegisteredSchemas(String publicId, String systemId) { InputSource source = resolveResourceFromRegisteredSchemasByNamespace(publicId); if (source == null) { // give a chance to systemId - in cases of xsd:import namespaceURI=<ns>, schemaLocation=<ns> that // (for some weird reason) result in search with publicId=null, systemId=<ns> source = resolveResourceFromRegisteredSchemasByNamespace(systemId); } LOGGER.trace("...... Result of registered schema resolve for publicId: {}, systemId: {}: {}", publicId, systemId, source); return source; }
@Override public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException { LOGGER.trace("--- Resolving entity with publicID: {}, systemID: {}", publicId, systemId); InputSource inputSource = resolveResourceFromRegisteredSchemas(publicId, systemId); if (inputSource == null) { inputSource = resolveResourceUsingBuiltinResolver(null, null, publicId, systemId, null); } if (inputSource == null) { LOGGER.error("Unable to resolve entity with publicID: {}, systemID: {}",new Object[]{publicId, systemId}); return null; } LOGGER.trace("==> Resolved entity with publicID: {}, systemID: {} : {}", publicId, systemId, inputSource); return inputSource; }
@Override public LSInput resolveResource(String type, String namespaceURI, String publicId, String systemId, String baseURI) { LOGGER.trace("--- Resolving resource of type {}, namespaceURI: {}, publicID: {}, systemID: {}, base URI: {}", type, namespaceURI, publicId, systemId, baseURI); InputSource inputSource = resolveResourceFromRegisteredSchemas(publicId, systemId); if (inputSource == null) { inputSource = resolveResourceUsingBuiltinResolver(type, namespaceURI, publicId, systemId, baseURI); } if (inputSource == null) { LOGGER.error("Unable to resolve resource of type {}, namespaceURI: {}, publicID: {}, systemID: {}, baseURI: {}", type, namespaceURI, publicId, systemId, baseURI); return null; } LOGGER.trace("==> Resolved resource of type {}, namespaceURI: {}, publicID: {}, systemID: {}, baseURI: {} : {}", type, namespaceURI, publicId, systemId, baseURI, inputSource); return new Input(publicId, systemId, inputSource.getByteStream()); }