[jdom-interest] Doctype entity declaration

Harry Evans hevans at elite.com
Fri Mar 9 17:24:15 PST 2001

So I've been looking at how to handle Entity Declarations with JDOM.  This
has opened a can of worms because it is also possible to have
elementDeclarations, attributeListDeclarations, notationDeclarations,
Processing Istructions, and Comments in the same place.  This comprises an
almost separate (albeit somewhat flat) tree of information rooted at the
doctype declaration.

I can see three ways of preserving this information in JDOM.  Since most of
the information is not actually used by the JDOM API, it could be
represented in some chunky format (the least sophisticated version of this
being a String), so that parsed documents have the ability to write this
information out when output.
The second way is to actually introduce some first class objects into the
JDOM tree for representing these things.  This would have the advantage of
allowing the declarations from parsed documents to be manipulated, and also
allow for the programmatic construction of these objects in non parsed
documents.  It would also allow them to be used by any JDOM native xslt
implementation or validating parsers that might come along.
The third way is a variation on the second.  It would entail building some
first class objects, but packaging them separately, and providing some
bridge between "inline" DTD declarations and the JDOM packaging.  It would
also allow for validation and xslt, but might get a little tricky in the
handling of packaging and which packages can see each other.

I kinda favor the second approach, but it entails (quite) a bit of work, and
results in the creation of at least four or five additional objects living
in org.jdom or some sub package.  Before I get much deeper into this, I
thought I would get some opinions on how all of you see this working.

Harry Evans

(Please see my early message for an exact description of what this is all

-----Original Message-----
From: Jason Hunter [mailto:jhunter at collab.net]
Sent: Wednesday, March 07, 2001 10:35 PM
To: Harry Evans
Cc: Jdom-Interest at Jdom. Org
Subject: Re: [jdom-interest] Doctype entity declaration

Harry Evans wrote:
> It just seems incomplete that SAX parses the entity, but JDOM doesn't
> that info. If there isn't anyone working on this, I might try to implement
> it, if anyone has any ideas on how it might work and other types that
> also be supported (if any).

It's so nice when someone spots a missing piece and instead of
complaining offers to help!

This is something in our TODO.  You're welcome to propose a design. 
It's something Brett's signed up to do, but he's fallen off the list
lately.  You may want to ping him at brett at jdom.org.

To control your jdom-interest membership:

More information about the jdom-interest mailing list