// explicit datatype factory is workaround for Jing bug wrt to OS X
PropertyMapBuilder properties = new PropertyMapBuilder();
RngProperty.DATATYPE_LIBRARY_FACTORY.put(properties,
new DatatypeLibraryFactoryImpl());
ValidationDriver driver = new ValidationDriver(
properties.toPropertyMap(),
CompactSchemaReader.getInstance());
InputStream schemaIn = schema.openStream();
try {
InputSource schemaSource = new InputSource(schema.openStream());
schemaSource.setSystemId(schema.toString());
driver.loadSchema(schemaSource);
return driver.validate(in);
} catch (SAXException e) {
System.out.println(e);
return false;
} finally {
schemaIn.close();