Get Next Attribute?

Anonymous
2004-04-20
2004-04-20
  • 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 - 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();
      }

       

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks