Skip to content

Instantly share code, notes, and snippets.

@jprudent
Created September 23, 2011 05:47
Show Gist options
  • Save jprudent/1236827 to your computer and use it in GitHub Desktop.
Save jprudent/1236827 to your computer and use it in GitHub Desktop.
How to read XML documents without validation
object MyXML 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", true);
f.setFeature("http://apache.org/xml/features/validation/schema", false);
f.newSAXParser()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment