Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Iterating an XML node list
public boolean elementExists(str elementName, str attributeName, str attributeValue)
{
XmlNodeList nodes = xmlDocument.GetElementsByTagName(elementName);
XMLNodeListIterator iterator = new XMLNodeListIterator(nodes);
while (iterator.moreValues())
{
XmlElement e = iterator.value();
str val = e.getAttribute(attributeName);
if (val == attributeValue)
{
return true;
}
iterator.nextValue();
}
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.