Hi,
you have to use importNode() method of the Document class if you want to do
cross-document transfers of nodes.
try somthing like:
Node node = ... (from doc1)
Node temp = doc2.importNode(node, true);
doc2.appendChild(temp);
regards,
Wolfram Frei
Frei GmbH
Hebelstr. 22
D-77866 Rheinau
Germany
fon: +49 7844 99280
fax: +49 7844 992828
mailto:[EMAIL PROTECTED]
-----Urspr�ngliche Nachricht-----
Von: kkumari [mailto:[EMAIL PROTECTED]]
Gesendet: Samstag, 16. Juni 2001 15:34
An: R Tate; [EMAIL PROTECTED]
Betreff: DOMException
Hi!
I have one more problem with replaceChild() method.
I have 2 Dom trees of the same implementation and having the samestructure.
Now i try to replace a node of the first tree with a node from 2nd tree. It
gives me a Dom exception(Wrong Document).Is this not a valid operation? Any
workaround for this??
thanks,
kusuma
----- Original Message -----
From: "R Tate" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, June 12, 2001 9:38 PM
Subject: Re: DOMException
> I usually get the parent node and add the child to it. I use JAXP to get
my
> document object, and DOM to build my document tree (the children). Could
it
> be posible that the XML database is giving you elements that are not
Xerces
> Elements? You could go into your debugger and check that out. If you add
> the Xerces source to your java path and remove the Xerces JAR file, you
> should be able to trace into the Xerces methods "insertBefore" and
> "replaceChild".
>
> Regards,
>
> Roy Tate
> Java Programmer
> Sequoyah Technologies, LLC
>
> ----- Original Message -----
> From: kkumari
> To: [EMAIL PROTECTED]
> Sent: Tuesday, June 12, 2001 9:51 AM
> Subject: DOMException
>
>
> Hi,
> I have a problem while appending nodes to the existing Dom Structure.
> I have an XML string which i get from an XML Database. Now i convert that
> into a Document node using DomParser. I have one Element called links in
the
> Domtree. Now if i try to create a new Element called links and try to
append
> it to the existing DomStructue i get DOM008 Exception. Then i tried using
> insertBefore() at the location where this node is supposed to go. This
time
> i get Dom006 Exception. I tried replaceChild() also. Nothing worked.I
don't
> undersatnt why i get DOMExceptions when i am trying to do valid
operations.
> Can anyone help me out?
> Thanks,
> kusuma
>
---------------------------------------------------------------------
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]