[jdom-interest] Element.setChildren(Element.getChildren())

Alex Rosen arosen at silverstream.com
Wed Jan 16 08:24:45 PST 2002


Have a look at the JDOM FAQ (on www.jdom.org).

Alex

-----Original Message-----
From: jdom-interest-admin at jdom.org [mailto:jdom-interest-admin at jdom.org]On
Behalf Of Markus Alin
Sent: Wednesday, January 16, 2002 11:08 AM
To: jdom-interest at jdom.org
Subject: [jdom-interest] Element.setChildren(Element.getChildren())


Dear all!!

 I have read an XML-file with the "org.apache.xerces.parsers.SAXParser" into
a JDOM tree. I can access all the Elements and Attributes in the tree
perfeclty with the different get functions that org.jdom.Element provides,
but when trying to move a set of Elements to another parent Element the
program throws an org.jdom.IllegalAddException. Typical the code I try to
execute looks like:

Element rootElement = document.getRootElement();
Element otherElement = new Element(<anyName>,<namepaceAsSameAsRootElement>);
otherElement.setChildren(rootElement.getChildren());

Why isn't this working??

Thanks, Markus



Markus Alintel:+41 1 455 70 00
Swissrisk AGfax:+41 1 455 70 01
Räffelstrasse 32mobile:+41 79 706 58 90
8045 Zürichmail:markus at swissrisk.com
Switzerlandhome:www.swissrisk.com




More information about the jdom-interest mailing list