private Schema getSchema(Source source, String currentDir, String scriptFileName) throws SAXException {
SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
SchemaResourceResolver resourceResolver = new SchemaResourceResolver(currentDir, scriptFileName, null);
schemaFactory.setResourceResolver(resourceResolver);
schemaFactory.setErrorHandler(new IgnoreSchemaErrorsErrorHandler());
return schemaFactory.newSchema(source);
}