[jdom-interest] Moving Elements and elt.detach()
Kevin Baynes
kbaynes at renex.com
Mon Mar 19 11:25:42 PST 2001
I have a list of Elements (e) that I am moving from one node to another. In
the JDOM FAQ it says to do it like this:
newParent.addContent( elt.detach() );
However, in JDOM b6 there is no such Element.detach() method, so I've been
looping over a list of Elements to remove and doing it like this:
otherNode.addContent( (Element)e.clone() );
List l = e.getParent().getChildren();
l.remove(e);
It seems like there should be an Element.remove() method (I intuitively
expected one to be there).
Am I missing an easier way? What happened to Element.detach()?
-Kevin Baynes
More information about the jdom-interest
mailing list