This page is no longer maintained — Please continue to the home page at

Disable XML DTD Validation

No replies
Eric Daugherty
Joined: 2009-05-25,
User offline. Last seen 42 years 45 weeks ago.
I'm writing a tool that parses an XML file created by a program on a user's local disk.  I'm using XML.loadFile, and the default behavior appears to validate the DTD (which requires an external HTTP request), but I would like to disable that behavior and ignore the DTD.  I don't see any obvious way to do this using the API (Scala 2.7.4).
It looks like the XML.loadFile code just defers to the underlying JDK parser, so I'm not sure how I get at the underlying API to disable it.
How do I disable DTD validation?

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland