How to access XML attributes
I have loaded some XML from an external source and the info I need is listed as an attribute on the xml group node.
How can the script access the XML attributes using the getXML snippet. I have tried accessing it with brackets "group["name"]" with no luck
example XML: <groups>
<
groupname
= "name1">url<
/group>
<
groupname
= "name2">url<
/group>
...
I'm unsure how to access the attribute name using the getXML code. I am able to retrieve the url so I know that part of the code is working.
CODE:
var configXML = Resources["ContentLoaderFunctions"].GetXML(params);
var groups = [];
for each (var group in configXML.groups.group){
groups.push(group);
}
var result = groups.join(",");

