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!
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.
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!
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();
}