[jdom-interest] DocType Modification

Frank Sauer Frank.Sauer at trcinc.com
Tue Jun 12 10:33:54 PDT 2001

You could use SAXBuilder.setEntityResolver and pass it an
EntityResolver that simply remembers the system and public ids
and use those to set on the DocType before writing it out.

Frank Sauer
The Technical Resource Connection, Inc.
a wholly owned subsidiary of Perot Systems
Tampa, FL
Java: The best argument for Smalltalk since C++

-----Original Message-----
From: Jason Hunter [mailto:jhunter at collab.net]
Sent: Tuesday, June 12, 2001 1:16 PM
To: Kevin Baynes
Cc: Jdom-Interest
Subject: Re: [jdom-interest] DocType Modification

Kevin Baynes wrote:
> I have an XML document with the following doctype declaration:
> <!DOCTYPE users SYSTEM "users.dtd">
> After using JDOM to open and modify the contents, JDOM writes the doctype
> as:
> "file:/C:/jakarta-tomcat-4.0-b1/webapps/kalispell/data/users.dtd">
> Why does this happen?

The SAX parser calculates the absolute path and passes it to JDOM.  JDOM
never sees the relative path.

> Is my usage incorrect?

Nope, you're doing fine.

> Is there a way to prevent this?

I really hope so.  But I don't know of any SAX feature addressing this. 
It may require JDOM plugging into the parser underneath SAX.  Anyone
have suggestions?

To control your jdom-interest membership:

More information about the jdom-interest mailing list