[jdom-interest] document order of elements

Jason Hunter jhunter at collab.net
Fri Aug 25 11:43:44 PDT 2000

Well, the only way to know would be by walking the tree.  If you have a
reference to an Element you can walk by calling getParent() to walk up
and getChildren() to walk down.  I'd need convincing this should be
standard in the Element API.


bob wrote:
> How (im)possible would it be for there to be a set of methods
> for checking document order of elements.
> Something like
>          boolean Element.before(Element that)
>          boolean Element.after(Element that)
> XPath muck sometimes cares about document order of Elements.
> >From the XPath implementation, we have lots of various Elements,
> but not in any particular single tree.  We might be holding
> a handful of subtrees from the original document.  And need to
> know their relative order.
> Thoughts?
>         -bob
> _______________________________________________
> To control your jdom-interest membership:
> http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhost.com

More information about the jdom-interest mailing list