SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
URL svgSchemaURL = SVGValidator.class.getResource("SVG.xsd");
Source schemaFile = new StreamSource(svgSchemaURL.openStream(), svgSchemaURL.toExternalForm());
Schema schema = factory.newSchema(schemaFile);
validator = schema.newValidator();
validator.setResourceResolver(new LSResourceResolver() {
@Override
public LSInput resolveResource(String type, String namespaceURI,
final String publicId, final String systemId, final String baseURI) {
if (logger != null) {
logger.log(TreeLogger.INFO, "resolveResource(" + type + ", " + namespaceURI + ", " + publicId + ", " + systemId + ", " + baseURI + ")");