[jdom-interest] insert

Ken Rune Helland kenh at csc.no
Thu Mar 22 04:00:14 PST 2001

At 02:34 AM 3/22/2001 -0800, elephantwalker wrote:
>don't know this for sure, but is there a way to "insert" and element in a
>particular order?
>if I have elements:
>  the beginning
>  the end
>And I would like to insert <b>the middle</b> in between <a> and <c>, how is
>it done?

Get the parent/root element (herafter called parent).


java.util.List content =  parent.getChildren()


java.util.List content =  parent.getMixedContent()

and insert it into the content list at the desired possition
using normal list metods.

See the doc for the difference between getChildren() and getMixedContent().

Best Regards


More information about the jdom-interest mailing list