Menu

Get Next Attribute?

Anonymous
2004-04-20
2004-04-20
  • Anonymous

    Anonymous - 2004-04-20

    Is there a way to loop through all the attributes of an element.  I see the FirstAttribute method and the LastAttribute method, but what I don't see is how to get the NextAttribute.

    I'd like to do something like:

    for (attr = elem->FirstAttribute() ; attr ; attr = elem->NextAttribute())
    {

    }

    Thanks!

     
    • Anonymous

      Anonymous - 2004-04-20

      Never mind ... I figured it out.  Here is how you do that:

      for (attribute = root->FirstAttribute() ; attribute ; attribute = attribute->Next())
      {
          name = attribute->Name();
          value = attribute->Value();
      }

       

Log in to post a comment.