[jdom-interest] Merging Documents

Aleksi Kallio aleksi.kallio at infomates.net
Tue Jul 18 02:30:02 PDT 2000

> First thing, HTML mail sucks.  It sometimes doesn't get quoted right for
> some reason.

Sorry about it. The first thing I always do when installing a mail client is to disable html-mail, but as I've been forced to change my mail client four times during last month I forgot it this time..
> Anyway, elements can only be in one place at a time.  That's because a
> getParent() call has to give one answer -- can't give two.  So elements
> have to be removed from one tree before added to another, or copied with
> getCopy().  In your case, a quick removal of the root before adding
> should work dandy.

If I interpret the code for Document in web-cvs correctly, it is possibly to change the root with the new setRootElement. Making a deep clone of Document would also help. 

In my outdated version of JDOM changing Document root is not possible, nor there is proper clone(). However, I finally managed to make my way through the setting and switch jungle of CVS and it is now updating my source tree. 

So I'll go and use my brand new JDOM to solve the problem. And don't worry - if it doesn't work, I will certainly come back to complain. :)

More information about the jdom-interest mailing list