Menu

problem with NextSibling

Developer
liran
2007-06-10
2013-05-20
  • liran

    liran - 2007-06-10

    i try to  to use the function NextSibling form TiXmlNode  with a tag name

    on this xml

    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <Form  xmlns="test1">
         <a1>11111111111111111119</a1>
         <a2>22222222222222222229</a2>
         <a3>13/03/2003</a3>
    <b1>
         <a4>xxxxxxxxx</a4>
         <a5>032155962</a5>
    </b1>
    </Form>

    if i search  the tag  a1 i found it
    but if i  serach the tag a4 i dont found it

    my code is:

    TiXmlDocument doc;

    doc.Parse(szXmlBuffer,0,TIXML_DEFAULT_ENCODING);

    TiXmlElement *pElement=m_doc.FirstChildElement();

    pNode=pElement->FirstChild();

    pNode=pNode->NextSibling("a4");

    end of  code

     
    • Nicola Civran

      Nicola Civran - 2007-06-11

      I may be wrong, but I think that "b1" is a sibling of "a1", "a2" and "a3", while "a4" and "a5" are simply children of "b1".

       

Log in to post a comment.