Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > problem in deleting a node from an xml file

Reply
Thread Tools

problem in deleting a node from an xml file

 
 
Sumeeta.
Guest
Posts: n/a
 
      03-17-2005
Hi,

Am new to xml, using the xercess c++ DOM parser .
I want to delete a node from the xml file. Have used th removeChild()
method...but nothin happens.. not even errors..
it executes but doesnt remove any node from the file.

here's the code snippet (that's after parsing and loadin the xml file)
DOMNode *root = pDoc1->getDocumentElement();
DOMNode *child = root->getFirstChild();
DOMNode *nextchild = child->getNextSibling();
child->removeChild(nextchild);

other than the deleting part.. rest of the code works fine.

Cud aneone help please
Thanks.

 
Reply With Quote
 
 
 
 
Soren Kuula
Guest
Posts: n/a
 
      03-17-2005
Sumeeta. wrote:
> Hi,
>
> Am new to xml, using the xercess c++ DOM parser .
> I want to delete a node from the xml file. Have used th removeChild()
> method...but nothin happens.. not even errors..
> it executes but doesnt remove any node from the file.
>
> here's the code snippet (that's after parsing and loadin the xml file)
> DOMNode *root = pDoc1->getDocumentElement();
> DOMNode *child = root->getFirstChild();
> DOMNode *nextchild = child->getNextSibling();
> child->removeChild(nextchild);


Maybe saving the results back into a file would help?

Soren

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Deleting data from the file without deleting the file first crea C++ 2 12-28-2012 11:50 PM
Re: Reading XML Node-by-Node Martin Honnen ASP .Net 0 11-12-2008 06:29 PM
xsl variable $node/text() but $node can non-node-set help! Tjerk Wolterink XML 2 08-24-2006 03:28 AM
how to creating new node inside a xml node Geagleeye ASP General 2 08-03-2006 12:09 PM
How to set the node indent property between the parent node and the leaf node viveknatani@gmail.com ASP .Net 0 02-13-2006 07:11 PM



Advertisments