harshabi wrote:
Hello all,
How can i delete(Remove) a node in the memory?? should i use a DOMNodelist
or DOMElement...For example consider the following snippet...
xercesc::DOMDocument* LXMLDoc = Lparser_.getDocument() ;


xercesc::DOMNodeList*
LNodeAddedList=LXMLDoc->getElementsByTagName(XercesString("Added")); xercesc::DOMNode* LNodeFileAddedElement=(DOMNode*)(LNodeAddedList->item(0));

xercesc::DOMNodeList*
LNodeAddedFileList=((DOMElement*)LNodeFileAddedElement)->getElementsByTagName(XercesString("Path"));

Let us say that i dont want the 2nd item in the LNodeAddedFileList (ie
LNodeAddedFileList->item(2)) how can i remove it??? will it affect the
DOMTree constructed (that is actually the effect i want)... Help me out with
this..
First of all, item(2) retrieves the third "Path" item, not the second one. If you want to remove that node from the DOM tree, you can use LNodeFileAddedElement->removeChild(LNodeAddedFileList->item(1)). The node will be actually removed from memory when the LXMLDoc object will be deleted.

Alberto


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

Reply via email to