JDom Element query

A

arun.hallan

I am using a JTree to output an XML file through dom.

What i want to do is as i create every node, i want to save the
corresponding element to that node (using setUserObject - so its hidden
in the node). I can do this fine.

The trouble is when i want to output the tree back to a DOM. When i try
to add the element from each node in the tree, i get an error saying
the element has already got a parent.

I see no way of removing a parent from each element, and have tried
just adding the root element but that hasnt worked.

Does anyone know how i can remove a parent from an element, so i can
add this element to another parent element??
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,265
Latest member
TodLarocca

Latest Threads

Top