[jdom-interest] Are Children under an Element returned in the proper order

Aspi Siganporia aspicool at yahoo.com
Thu Mar 8 05:55:11 PST 2001


Hi,

When we invoke the method Element.getChildren() does the return list
maintain the order in which the children existed in the XML.


For example, if I have an XML section

...

<A>
  <B>
   ...
  </B>
  <C/>
  <B>
   ...
  </B>
  <C/>
   ...
  <C>
  <C/>
</A>

If I have a reference to Element 'A'

Element a;

and I invoke the method,

a.getChildren()

will I get the elements in the list as B,C,B,C,C

or if I invoke the method

a.getChildren("C")

will I get the three C elements in the order in which they occurred in
the original XML section.

I do not see any comment to that effect in the JDOM API javadoc and we
are curious if it can be assumed.

Thanks
Aspi




More information about the jdom-interest mailing list