[jdom-interest] A plea for the orphans

Amy Lewis amyzing at talsever.com
Sat Sep 16 09:27:09 PDT 2000


Hmmm.

While we're on the topic of children, I'd like to request a change to
the API.

I'd like to see Attribute, Comment, Processing Instruction, and
possible Entity contain a member, Element parent, with getParent() (but
possibly no setParent(); I'm not convinced we need it entirely).  This
would require that the builders set the parent attribute, and would
require that the changing of content also perform a verification step
(which is potentially expensive).

I'd like to see this, because I want better navigation.  It isn't
necessary to get as complex as DOM, but without the ability to move
upward in the tree (downward is usually possible), then any attempt to
implement a TreeIterator (seems to me the basic element for
navigability) requires saving a truly inordinate amount of state on the
way.

Elements have parents.  Was there a particular reason that the other
children (umm, and attributes, too, since they're not considered
children) don't have parents (matter of fact, attributes are
specifically noted as having parents in XPath, even though they aren't
children).

Amy!
-- 
Amelia A. Lewis          alicorn at mindspring.com          amyzing at talsever.com
Did you exchange a walk-on part in the war for the lead role in a cage?
		-- Pink Floyd



More information about the jdom-interest mailing list