Hi,
        There are two possible problems:

1. You cannot use append child directly to copy a part of a DOM tree into 
another one. You have to use 

importNode(Node importedNode, boolean deep) 

of the Document interface.


2. Another problem you can face even after using the above is incompatibility 
between two DOMs, i.e. One of the document object can be a DOM 1 object where 
as the other can be DOM 2. But you need not worry about this if you are using 
the same Xerces package for creating all the documents.

Hope this helps,

Rajesh.

-----Original Message-----
From: OEzguer Demir [mailto:[EMAIL PROTECTED]
Sent: Monday, April 29, 2002 7:35 PM
To: [EMAIL PROTECTED]
Subject: Newbie: how do i copy a Dom tree to another dom document


Hi!

I am new to Xerces 2 for Java and i am trying to copy a part of a dom tree to a 
new dom document but with cloneNode(true) and then appendChild(..), i just get 
a 
DOMException:

DOMException: DOM005 Wrong document

So i looked at DOMException! It just tells me that i cannot use a node in a 
document which it did not create it! *grmbl*

Is there any help (method) or do i have to write recursive function which is 
creating all the elements and values?

thnx
OEzguer Demir

p.s.: sorry for my bad english!




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to