Skip to content

Instantly share code, notes, and snippets.

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;
return false;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment