hello all, i have a JDOM Document. i would like to add the content of this document's root element to the root element of another document. here is my attempt:
Exception in thread "main" org.jdom.IllegalAddException: The Content already has an existing parent "elem"
Hi, I had faced a similar issue when i was working with JDOM, and i tried working with the detach() method, but was unsuccessful.The following approach will solve your problem i also found another solution:
// get content of root element List content = doc1.getRootElement().cloneContent();
cloneContent() instead of getContent() does it. you don't have to detach then.
He loves you so much! And I'm baking the cake! I'm going to put this tiny ad in the cake: