You cannot import a Document node into another Document.  You can import
the document Element, but the the Document itself:

    DOM_Node aNode = parser.getDocumentElement();
    DOM_Node newNode = root_doc.importNode(aNode, true);

Dave



                                                                                       
                                                   
                    "Mohammed Zubair"                                                  
                                                   
                    <mohammed.visharam@am        To:     "Xerces" 
<[EMAIL PROTECTED]>                                           
                    .sony.com>                   cc:     (bcc: David N 
Bertoni/CAM/Lotus)                                                 
                                                 Subject:     Problem regarding 
importing a Node                                          
                    04/06/2001 10:42 AM                                                
                                                   
                    Please respond to                                                  
                                                   
                    xerces-c-dev                                                       
                                                   
                                                                                       
                                                   
                                                                                       
                                                   



Hi,
 I have the following scenario.

1.  I am building an XML document on the fly. For this i have a
DOM_Document
called root_doc which does the job.
2.  Somewhere in midst i have to read a small (well formed) xml document
(called frag_doc) from the disk and add this to the current document in
memory.
   For this i call the DOMParser, parse this frag_doc from disk and assign
it to a DOM_Node, like this.
                     DOM_Node aNode = parser.getDocument();

NOw the problem i am facing is that i am not able to attach this Node
(aNode) into the document in memory. I tried using the importNode function
but it gives me the NOT_SUPPORTED_ERR. I tried to import it using the
following method.
           DOM_Node newNode;
           newNode = root_doc.importNode(aNode,true);
Here it gives me an exception in the try clause.

Any suggestions would be helpful.

Thanks,
Mohammed Zubair V


---------------------------------------------------------------------
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