[jdom-interest] Problem locating .dtd via relative path with xerces 1.4.4

Norrman Per per.norrman at canovia.se
Thu Aug 15 01:58:36 PDT 2002


I would recommend using an org.xml.sax.EntityResolver:

        SAXBuilder builder = new SAXBuilder(...);
        builder.setEntityResolver(new EntityResolver() {
        	public InputSource resolveEntity(String publicId, String
systemId) throws SAXException, IOException {
		    // locate the DTD ...
                return new InputSource(....);
		}
	  });
        Document doc = builder.build(...);

Now you have complete control, which is better than relying on
the specific parser implementation details.


-----Original Message-----


We've just upgraded from jdom-b7 to jdom-b8 and sadly our application has 
broken.

All our .xml files have a doctype like this

<!DOCTYPE ScriptProperties SYSTEM "ScriptProperties.dtd">

Note the relative path.

###########################################

This message has been scanned by F-Secure Anti-Virus for Microsoft Exchange.
For more information, connect to http://www.F-Secure.com/



More information about the jdom-interest mailing list