[jdom-interest] How to add two nodes with the same name on the same level?

Paul Libbrecht paul at activemath.org
Wed Jan 14 00:37:10 PST 2009


you need to duplicate them first.
Element objects correspond to concrete elements in the tree since you  
can get parent or iterate through the list so you really have to make  
two different objects.
Using clone() is an easy way to duplicate. After a case, you can  
addContent again.


Le 14-janv.-09 à 08:31, junk_mail at wp.pl a écrit :
> Is it possible to add two nodes with the same name on the same level  
> of
> xml file using .addcontent() method?
> I'm trying to do so and I get following error:
> Exception in thread "main" org.jdom.IllegalAddException: The Content
> already has an existing parent "tree"...
> Is there any way to disable that execption and force jdom to create  
> two
> nodes with the same name?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2203 bytes
Desc: not available
Url : http://www.jdom.org/pipermail/jdom-interest/attachments/20090114/b4f65fd3/smime.bin

More information about the jdom-interest mailing list