[jdom-interest] Can't get SAXBuilder to ignore DOCTYPE

Dino Fancellu dino.fancellu at ntlworld.com
Wed Oct 11 05:30:42 PDT 2000

I have an XML file with a DOCTYPE like this:


Now, I want the builder to ignore the dtd, i.e. do not validate.

I create my builder, thus:

SAXBuilder builder = new SAXBuilder(false);

But I get errors from the builder/parser when I'm not online:

org.jdom.JDOMException: www.pensionsbusiness.com: www.pensionsbusiness.com
        at org.jdom.input.SAXBuilder.build(SAXBuilder.java:320)
        at org.jdom.input.SAXBuilder.build(SAXBuilder.java:373)
        at org.jdom.input.SAXBuilder.build(SAXBuilder.java:354)
        at playpen.testxml.main(testxml.java:40)
Root cause: java.net.UnknownHostException: www.pensionsbusiness.com
 [stuff deleted]
        at org.jdom.input.SAXBuilder.build(SAXBuilder.java:302)

Basically, it (Xerces) can't find the URL, which is fair enough, but I was
hoping that it wouldn't even look,
as I don't want validation.

What am I doing wrong? I'm no XML expert, I'd just like to be able to ignore
validation and I thought SAXBuilder(false)
would do that for me.

Thanks for any help.


More information about the jdom-interest mailing list