Last active
August 29, 2015 14:13
-
-
Save kevinhooke/97f5142d4859287c1492 to your computer and use it in GitHub Desktop.
Disable JAXP DTD loading and validation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); | |
dbf.setValidating(false); | |
dbf.setNamespaceAware(true); | |
//one of these pairs of properties will work depending on which xml api impl is in use | |
dbf.setFeature("http://xml.org/sax/features/namespaces", false); | |
dbf.setFeature("http://xml.org/sax/features/validation", false); | |
dbf.setFeature("http://apache.org/xml/features/nonvalidating/load-dtd-grammar", false); | |
dbf.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment