per at onclave.com
Fri May 18 13:52:39 PDT 2001
I'm trying this to make a copy of all the content within one element to
void copyContents(Element src, Element dest)
Given two elements with this schema:
With the latest JDOM code, I get an exception:
org.jdom.IllegalAddException: The element "title" could not be added as a
child of "item": The element already has an existing parent "item"
What is it I should be doing?
- in the previous version of the function, the elements were copied but
parenting was left pointing at the previous parent
- Cloning the src element first would still leave all its content pointing
clone and presumably still raise the exception.
- should setMixedContent() be detaching each node before moving it?
- should I clone the src, detach all the nodes within, then add them one by
More information about the jdom-interest