[jdom-interest] EntityRef questions

Jason Hunter jhunter at collab.net
Fri Jun 1 18:11:43 PDT 2001


> 1. If I have in a document 1 million references to an entity, the
> EntityRef will be present a million times in memory with the same publicID
> and systemID? The parent is the only one that differs.

Yes.  I doubt that'll be a serious problem for anyone.  Note that by
default and in the common case entities are expanded.

> 2. Doesn't EntityRef look too close to EntityDecl's ExternalID (XML
> Recommendation 1.0)? Why not use an EntityDecl in a DTD, and make
> EntityRef something like:
>    - protected Document document
>    - protected java.lang.String name
>    - protected Element parent
>    - protected EntityDecl reference
> with the appropriate constructors, getters and setter?

We don't have an EntityDecl class.  We've decided for the time being to
store internal DTD subsets as String.  You can learn more about this in
the archives of the discussion following the SD West BOF.  Look for
posts by me with BOF probably in the subject.

> 3. In the case of the current EntityRef, what possibilities do I have to
> manipulate external entities using JDOM? Shouldn't a Entity (close to
> Element) be present (like it was before), but with better support?

External entities can be manipulated as XML read into JDOM, but not
indirectly as part of a separate document.  The problem with indirectly
manipulating external entities is that on output what do you do with the
modified external entity data?  It'd be lost.

-jh-



More information about the jdom-interest mailing list