Hello,

You should call importNode first. Something like that:


DOM_Node theTrgNode, theSrcNode, theChildNode;

// get source and target Nodes ...

(theSrcNode.getOwnerDocument() == theTrgNode.getOwnerDocument())
? theChildNode = theSrcNode
:  theChildNode = theTrgNode.getOwnerDocument().importNode(theSrcNode,
true/*deep import*/);

theTrgNode.appendChild(theChildNode);


Another question (that wasn't answered) is.
importNode is the experemential routine. What does it mean?
Will it be supported in the future releases?

Greetings
David Ostrovsky



                                                                                
                                                                
                    [EMAIL PROTECTED]                                           
                                                                  
                    tscape.net             An:     [EMAIL PROTECTED]            
                                                        
                                           Kopie:                               
                                                                
                    21.03.01 09:05         Thema:  can't insert a node in Xml 
documents                                                         
                    Bitte antworten                                             
                                                                
                    an xerces-dev                                               
                                                                
                                                                                
                                                                
                                                                                
                                                                




Hello,
I have some problems with handling XML documents. in fact I'have an XML
Document that I extracted from a DOMParser. I'm trying to add a node in
this Document giving the node and the path where it must be added. The new
Node is retrived from another Xml String then the one that was used in
construncting the Original Document.

Any time I tried to insert the new Node in the right path I catched a
DOMException (DOM005 Wrong document) (In fact I retrieved the Node under
which the new one must be inserted and tried Node.appendChild(newNode) ).

Could you please help me by telling me what is wrong in this? and how shall
I proceed ?

Thanks.
Best regards.

B. CHARRADA Mehdi
Developper ingeneer
IIC
__________________________________________________________________
Get your own FREE, personal Netscape Webmail account today at
http://webmail.netscape.com/



Reply via email to