problem in deleting a node from an xml file

Discussion in 'XML' started by Sumeeta., Mar 17, 2005.

  1. Sumeeta.

    Sumeeta. Guest

    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.
     
    Sumeeta., Mar 17, 2005
    #1
    1. Advertising

  2. Sumeeta.

    Soren Kuula Guest

    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
     
    Soren Kuula, Mar 17, 2005
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    1,643
  2. Tjerk Wolterink
    Replies:
    2
    Views:
    1,504
    Dimitre Novatchev
    Aug 24, 2006
  3. Harry Barker
    Replies:
    2
    Views:
    543
    Alf P. Steinbach
    Apr 19, 2006
  4. Martin Honnen

    Re: Reading XML Node-by-Node

    Martin Honnen, Nov 12, 2008, in forum: ASP .Net
    Replies:
    0
    Views:
    406
    Martin Honnen
    Nov 12, 2008
  5. crea
    Replies:
    2
    Views:
    440
    Nobody
    Dec 28, 2012
Loading...

Share This Page