log.error(e.toString(), true);
}
}
private boolean validXML(File xmlFile, File xsdFile) {
XMLErrorHandler errorHandler = new XMLErrorHandler();
try {
if (reader == null) {
reader = new SAXReader();
reader.setValidation(true);
reader.setFeature("http://xml.org/sax/features/validation", true);
reader.setFeature("http://apache.org/xml/features/validation/schema", true);
reader.setProperty("http://apache.org/xml/properties/input-buffer-size", 8 * 1024);
}
reader.setProperty("http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation",
xsdFile.getAbsolutePath());
reader.setErrorHandler(errorHandler);
reader.read(xmlFile);
if (writer == null) {
writer = new XMLWriter(OutputFormat.createPrettyPrint());
}
if (errorHandler.getErrors().hasContent()) {
writer.write(errorHandler.getErrors());
return false;
} else {
return true;
}
} catch (Exception e) {