[jdom-interest] EntityRef questions

Stefan ALBOI sbll at ss.pub.ro
Sat Jun 2 19:24:33 PDT 2001

On Fri, 1 Jun 2001, Jason Hunter wrote:

> > 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-

I don't think about modifying external entities. Let's say no methods for
modifying external entities, but from the memory consumption point of view
it would be swell if an external parsed entity is stored expanded into
memory only once. I give you the example with 1 million references to an
external parsed entity again.

Why not use both: Entity and EntityRef?

More information about the jdom-interest mailing list