Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » JDOM User »

[jdom-interest] create xml tree

Mikael Petterson (KI/EAB)

2004-02-02

Replies:

Hi,

I am trying to find out if there is a way of adding children in a way that the parent-child relation will be kept.

I have a method to create the relation inbetween parent and child. I then want to make a recursive add of
children to each parent. I have about 8 levels of parent-child relations. Doing

parent.addContent(child);

seems only to add the first level. How can I make it recursive?

Do I have to keep track of the element that I start to add children to and when all my addContent have been done I add the first element to the
root and last create a Document?

BR

//Mikael

This communication is confidential and intended solely for the addressee(s). Any unauthorized review, use, disclosure or distribution is prohibited. If you believe this message has been sent to you in error, please notify the sender by replying to this transmission and delete the message without disclosing it. Thank you.

E-mail including attachments is susceptible to data corruption, interruption, unauthorized amendment, tampering and viruses, and we only send and receive e-mails on the basis that we are not liable for any such corruption, interception, amendment, tampering or viruses or any consequences thereof.

_______________________________________________
To control your jdom-interest membership:
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@(protected)


©2008 junlu.com - Jax Systems, LLC, U.S.A.