[jdom-interest] insertChild in Element

David W. Smiley dsmiley at mitre.org
Thu Aug 31 08:49:37 PDT 2000

trebor.a.rude at lmco.com wrote:
> So which would you prefer?  If I had to choose, I'd say go with the current
> implementation and in fact maybe even get rid of the existing
> addContent/removeContent functions that are currently in Element (except
> maybe for the ones that deal with the text content), so that all
> manipulation of the children is through the List. The user can choose
> between getChildren() and getMixedContent() depending on if they want just
> the Element children or all of them.
> Trebor A. Rude
> trebor.a.rude at lmco.com

Agreed; that would be consistent.  Having an "Element.addContent" and
"Element.getChild" (with all overloaded variations) should remain,
however, since they are just so common.  This issue is paralleled with
that of attributes.

On the side... I like the idea that Eric Galluzzo has in which elements
added and obtained default to the namespace to that of the parent
element.  That is intuitive and promotes the idea of scope.  After all,
in my Java code I certainly don't use fully qualified package names for
classes in the same package as I'm writing :-).

-- Dave Smiley

More information about the jdom-interest mailing list