problem in deleting a node from an xml file


S

Sumeeta.

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

Advertisements

S

Soren Kuula

Sumeeta. said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top