[jdom-interest] Moving Elements around...

philip.nelson at omniresources.com philip.nelson at omniresources.com
Sun Apr 22 19:30:41 PDT 2001

To move elements around within a document or between documents, get the
element, .detach() it from the document, add it as content somewhere else
with .addContent().

Beware you don't detach the root element though. You could be in for a long
discussion 'round here :^)

> -----Original Message-----
> From: Yong Kim [mailto:emoogee at yahoo.com]
> Sent: Sunday, April 22, 2001 5:50 PM
> To: jdom-interest at jdom.org
> Subject: [jdom-interest] Moving Elements around...
> Hi,
> I'm currently working on a project that requires many
> iteration of moving elements around a XML document. 
> (Of course, I'm using JDOM for this project and I've
> been loving it... :))..  So, I was thinking what would
> be the best way to deal with this kind of situation...
>  Maybe I'm wrong, but I couldn't find anything on this
> from JDOM...  Maybe, I'm talking about something
> that's really pointless to talk about but I'd like to
> see what you guys think...  Would it be nice if we
> have a method in JDOM Document class that moves around
> Element within the XML Document???  Maybe I'm going
> too far but it might be interesting if we can move
> Elements from one XML Document from another...
> As an interim, does anyone have good suggestion on how
> to move Elements around???
> Thanks,
> Sean Kim
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Auctions - buy the things you want at great prices
> http://auctions.yahoo.com/
> _______________________________________________
> To control your jdom-interest membership:
> http://lists.denveronline.net/mailman/options/jdom-interest/yo
uraddr at yourhost.com

More information about the jdom-interest mailing list