[jdom-interest] Re: Can't we all get along? :) -- [is] getChild() vs.getChildElements()

Patrick Dowler Patrick.Dowler at nrc.ca
Thu Aug 3 16:38:27 PDT 2000

On Thu, 03 Aug 2000, Elliotte Rusty Harold wrote:

[concerning "getElement"]

> I can certainly live with it, though I still prefer 
> getChildElement(). It's more descriptive and easier to read. There 
> are other elements in the document that are not children; e.g. the 
> parent, ancestor, and sibling elements.  I can see someone thinking 
> that getElement() searches any or all of these or even returns the 
> element itself.

Really? That seems like a stretch... I really doubt anyone would expect
"get" to search anywhere but under the target Element. Searching deeper
means using XPath or a search algorithm (tree-walker).

There is no end if you start thinking that way: "getSibling"? "getUncle"?
"getNephew"? "getGrandChild"? "getSecondCousinTwiceRemoved" :-)

Patrick Dowler
Canadian Astronomy Data Centre

More information about the jdom-interest mailing list