[jdom-interest] SubDocuments

Andres March Andres at ehealthcontracts.com
Sat May 25 15:06:32 PDT 2002


Thanks. I went ahead and changed my code to work correctly.  I'm glad jdom is enforcing this now.  The only problem I have left is this serialization thing.  Don't know why it worked in b6 and not in b8.

-Andres

-----Original Message-----
From: Jason Hunter [mailto:jhunter at servlets.com]
Sent: Friday, May 24, 2002 5:40 PM
To: march at andres.ws
Cc: jdom-interest at jdom.org
Subject: Re: [jdom-interest] SubDocuments


Over time JDOM has been getting more careful about ensuring document
well formedness.  One rule is that an element can have at most one
parent.  Otherwise you can allow loops in your tree for example.  If you
want to steal an elt from another document, just call detach() on the
elt to remove it from its old place.  If you need it duplicated, you'd
need to clone() it.

-jh-

andres wrote:
> 
> I have inherited a system that uses JDOM documents for the navigation.
>  I am trying to upgrade to b8 but the way we use the documents is an
> issue.  Is it possible in b8 to use an Element from an existing Document
> to create a new Document?  Anybody know why this worked in b6 and, I
> think, b7?  I would like to be using this library correctly but I also
> don't want to rewrite my entire navigation subsystem.  The error that
> occurs from when I do:
> 
> new Document(anElementFromAnotherDocument);
> 
> is of course that it already has an existing parent.
> 
> Basically, navigation is determined by an "activity" xml and each
> element directly under the root is a Tab in the GUI.  When a Tab is
> clicked the navigator takes the Tab Element and creates a new Document
> that becomes the navigation for the GUI.
> 
> _______________________________________________
> To control your jdom-interest membership:
> http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhost.com
_______________________________________________
To control your jdom-interest membership:
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhost.com



More information about the jdom-interest mailing list