[jdom-interest] Newbie question.

Ian Lea ian.lea at blackwell.co.uk
Mon Dec 31 02:42:51 PST 2001

Element el = tt.getChild("MsData");
Document doct = new Document(el);

Could also consider clone() but detach() seems more appropriate here.

ian.lea at blackwell.co.uk

nostromo at arcor.de wrote:
> Hi!
> I wanted to make a new document from a part of a bigger document.
> I retrieve a Element from the bigger document:
> Element el = tt.getChild("MsData");
> And want to made it the root of a new document.
> Document doct = new Document(el);
> At runtime i got the following error.
> org.jdom.IllegalAddException: The element "MsData" could not be added as the root of the document: The element already has an existing parent "db"
> Any hints or solutions?
> I am new to jdom, xml and java.
> Erik
> jdom verion
> jdom-7b

More information about the jdom-interest mailing list