schemaFactory.setResourceResolver(DEFAULT_RESOURCE_RESOLVER);
Schema schema = schemaFactory.newSchema(SCHEMAS);
Validator validator = schema.newValidator();
validator.setFeature("http://apache.org/xml/features/validation/schema", true);
validator.setResourceResolver(DEFAULT_RESOURCE_RESOLVER);
validator.validate(new StreamSource(getXmlFile(xmlName)));
}
private File getXmlFile(String xmlName) throws IOException {
// Copy the input file to tmp, replacing system prop expressions on non-string fields