Copy link to clipboard
Copied
How to read the attribute values in the below xml file.
<List>
<p name="DZPNumber" replacement="PN"/>
<p name="DZPTitle" replacement="PT"/>
</List>
var myXMLFile = File("/WorkSpace//Collection.xml")
myXMLFile.open('r');
var allElements = new XML(myXMLFile.read());
myXMLFile.close();
var nodes = allElements[0].xpath("//p");
for(var i = 0; i < nodes.length(); i++){
$.writeln (nodes[i])
}
Use the @notation like follows
nodes[i].@name
-Manan
Copy link to clipboard
Copied
Use the @notation like follows
nodes[i].@name
-Manan