Created
May 7, 2020 12:33
-
-
Save Krever/258d54022dcc37237f0ae1fbefde917d to your computer and use it in GitHub Desktop.
Make sax parser offline
This file contains hidden or 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
object MyXMLParser extends XMLLoader[Elem] { | |
override def parser: SAXParser = { | |
val f = javax.xml.parsers.SAXParserFactory.newInstance() | |
f.setNamespaceAware(false) | |
f.setValidating(false) | |
f.setFeature("http://apache.org/xml/features/disallow-doctype-decl", false); | |
f.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false); | |
f.newSAXParser() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment