This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
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"
how can i do this? thank you!
rodd manning
Greenhorn
Joined: Mar 06, 2007
Posts: 15
posted
0
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.