Hi Erik 
I have tried what you have suggested ...

DOM_DOMImplementation implt;
        DOM_Document newdoc =
(DOM_Document)implt.createDocument(docSrc.getNamespaceURI(),
docSrc.getDocumentElement().getNodeName().transcode(),docSrc.getDoctype());
    DOM_Node newnode = newdoc.importNode(docSrc.getDocumentElement(), true);
//cout<<newdoc;
    try
        {
        newdoc.replaceChild( newnode,newdoc.getDocumentElement());
        }catch(DOM_DOMException &e)
        {
                cout<<e.msg.transcode()<<e.code;
        }
The execution of this part of the code is catched with e.code =3 .ie
NO_MODIFICATION_ALLOWED_ERR
Plz let me know how to come out of this situation ..
Waiting for your reply
With Warm Regards
Ravi Jain


> ----------
> From:         Erik Rydgren[SMTP:[EMAIL PROTECTED]]
> Reply To:     [EMAIL PROTECTED]
> Sent:         Friday, February 22, 2002 18:48
> To:   'Ravi_Jain'
> Subject:      RE: DOM_Document problem...HELP REQUIRED URGENTLY
> Sensitivity:  Confidential
> 
> I do not think so. Sorry. You need a new document (which is a new memory
> pool as well) to be able to import nodes into it. But it wouldn't be that
> many rows of code and to make it transparent just inherit DOM_Document
> into
> your own document class like this.
> 
> class myDocument : public DOM_Document
> {
> public:
>   myDocument cloneDocument() {
>     myDocument newdoc = (myDocument)
> getImplementation()->createDocument(getNamespaceURI(), getNodeName(),
> getDoctype());
>     DOM_Node newnode = newdoc.importNode(getDocumentElement(), true);
>     newdoc.replaceChild(newnode.getDocumentElement(), newnode);
>     return newdoc;
>   }
> };
> 
> Hard casting between myDocument and DOM_Document is safe because you have
> no
> members in the myDocument class.
> I have not tested this code but it should work with some minor changes.
> 
> / Erik
> 
> -----Original Message-----
> From: Ravi_Jain [mailto:[EMAIL PROTECTED]]
> Sent: den 22 februari 2002 10:56
> To: [EMAIL PROTECTED]
> Subject: RE: DOM_Document problem...HELP REQUIRED URGENTLY
> Sensitivity: Confidential
> 
> 
> Thanks Erik !
> Is there no straight way as importing  of "DOM_Document"?
> 
> Regards
> Ravi Jain
> 
> 
> > ----------
> > From:       Erik Rydgren[SMTP:[EMAIL PROTECTED]]
> > Reply To:   [EMAIL PROTECTED]
> > Sent:       Friday, February 22, 2002 15:06
> > To:         [EMAIL PROTECTED]
> > Subject:    RE: DOM_Document problem...HELP REQUIRED URGENTLY
> > Sensitivity:        Confidential
> >
> > You will have to create a new document and then copy nodes from the
> > original
> > document by importing them into the new document.
> >
> > Regards
> >
> > Erik Rydgren
> > Mandarinen systems AB
> > Sweden
> >
> >
> > -----Original Message-----
> > From: Ravi_Jain [mailto:[EMAIL PROTECTED]]
> > Sent: den 22 februari 2002 07:16
> > To: [EMAIL PROTECTED]
> > Subject: RE: DOM_Document problem...HELP REQUIRED URGENTLY
> > Sensitivity: Confidential
> >
> >
> > > Hi All
> > > I am passing  reference of DOM_Document to a function where I am
> > modifying
> > > the DOM_Document and hence the DOM_Document change is reflected in my
> > main
> > > program
> >     I have tried same by first copying original DOM_document instance to
> > another variable and passed this variable to my function.
> > But in this case when I refer to my original DOM_Document in main
> program
> > after making function call , I can see the changes that my fuction
> should
> > have done ..
> > Is there any way to clone DOM_Document or any other way to solve this
> > problem..
> >
> > > Thanks in Advance
> > > With Warm Regards
> >       Ravi Jain
> >
> >
> >
> **************************************************************************
> > This email (including any attachments) is intended for the sole use of
> the
> > intended recipient/s and may contain material that is CONFIDENTIAL AND
> > PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying
> > or
> > distribution or forwarding of any or all of the contents in this message
> > is
> > STRICTLY PROHIBITED. If you are not the intended recipient, please
> contact
> > the sender by email and delete all copies; your cooperation in this
> regard
> > is appreciated.
> >
> **************************************************************************
> >
> > ---------------------------------------------------------------------
> > 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]
> >
> **************************************************************************
> This email (including any attachments) is intended for the sole use of the
> intended recipient/s and may contain material that is CONFIDENTIAL AND
> PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying
> or
> distribution or forwarding of any or all of the contents in this message
> is
> STRICTLY PROHIBITED. If you are not the intended recipient, please contact
> the sender by email and delete all copies; your cooperation in this regard
> is appreciated.
> **************************************************************************
> 
************************************************************************** 
This email (including any attachments) is intended for the sole use of the
intended recipient/s and may contain material that is CONFIDENTIAL AND
PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying or
distribution or forwarding of any or all of the contents in this message is
STRICTLY PROHIBITED. If you are not the intended recipient, please contact
the sender by email and delete all copies; your cooperation in this regard
is appreciated.
**************************************************************************

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

Reply via email to