Skip to content
Snippets Groups Projects
Commit 23e7215d authored by Andreas Romeyke's avatar Andreas Romeyke
Browse files

- minor, indenting

parent 469eb9e2
No related branches found
No related tags found
No related merge requests found
......@@ -20,29 +20,25 @@ public class SLUBValidateDTD {
}
private final DocumentBuilderFactory dbf = DocumentBuilderFactory.newDefaultNSInstance();
public boolean validateAgainst(String filePath) throws IOException, ParserConfigurationException {
dbf.setValidating(true);
assert(dbf.isValidating());
dbf.setFeature(XMLConstants.USE_CATALOG, true);
//dbf.setAttribute("http://apache.org/xml/features/nonvalidating/load-external-dtd", false); // MATHML 2.0 triggers an error if enabled
dbf.setAttribute(XMLConstants.FEATURE_SECURE_PROCESSING, true);
dbf.setIgnoringElementContentWhitespace(true);
dbf.setNamespaceAware(true);
DocumentBuilder dbValidate = dbf.newDocumentBuilder();
assert(dbValidate.isValidating());
//reportDetail("align entitity resolver");
dbValidate.setEntityResolver(validationCatalogResolver);
dbValidate.setErrorHandler(slubXmlErrorHandler);
//reportDetail("reparse using own catalog");
dbf.setValidating(true);
assert (dbf.isValidating());
dbf.setFeature(XMLConstants.USE_CATALOG, true);
//dbf.setAttribute("http://apache.org/xml/features/nonvalidating/load-external-dtd", false); // MATHML 2.0 triggers an error if enabled
dbf.setAttribute(XMLConstants.FEATURE_SECURE_PROCESSING, true);
dbf.setIgnoringElementContentWhitespace(true);
dbf.setNamespaceAware(true);
DocumentBuilder dbValidate = dbf.newDocumentBuilder();
assert (dbValidate.isValidating());
//reportDetail("align entitity resolver");
dbValidate.setEntityResolver(validationCatalogResolver);
dbValidate.setErrorHandler(slubXmlErrorHandler);
//reportDetail("reparse using own catalog");
try {
dbValidate.parse(new File(filePath));
//} catch (SAXException e) {
//} catch (SAXException e) {
} catch (Exception e) {
System.out.println("ERROR: " + e.getMessage());
}
return slubXmlErrorHandler.is_Valid();
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment