XMLAttributeList
An XML element can have more than one attribute. To process all attributes at
once, you must store them in a list. XMLAttributeList
is a
data type that holds such a list. This process example outputs the names and values of all
attributes of an element:
#define EngineVersion 5.0
#define RuntimeVersion 5.0
void XmlAttributeListDemo()
{
XMLDocument document = XMLParseDocument("<root attribute1='value1' attribute2='value2'/>");
XMLAttributeList attributes = XMLGetAttributes(XMLGetRootElement(document));
foreach (XMLAttribute attribute in attributes)
{
WriteLine(XMLGetLocalName(attribute) + "=" + XMLGetValue(attribute));
}
}