schema = factory.newSchema(source);
Validator validator = schema.newValidator();
validator.validate(new DOMSource(document));
}
catch (SAXParseException e) {
throw new ExecutionException("Error on " + e.getLineNumber() + ", column " + e.getColumnNumber() + " in " + description + ": " + e.getMessage(), e);
}
catch (SAXException e) {
throw new ExecutionException("Error parsing " + description + ": " + e.getMessage(), e);
}
catch (IOException e) {
throw new RuntimeException(e);
}
}