Forum Discussion
TheEndless
14 years agoRoku Guru
This code will print the value of the "value" attribute of each "param" node:
The GetAttributes() method returns an associative array whose keys are the names of the attributes, so the GetAttributes() for the paramNode in your example would contain two keys: "name" and "value"
You can access attributes either using the "@" shortcut notation in the above code (if there are no special characters in the attribute name), or via the GetAttributes() associative array.
xmlString = "<adhocparams>....</adhocparams>"
xml = CreateObject("roXmlElement")
If xml.Parse(xmlString) Then
For Each paramNode In xml.param
print paramNode@value
Next
End If
The GetAttributes() method returns an associative array whose keys are the names of the attributes, so the GetAttributes() for the paramNode in your example would contain two keys: "name" and "value"
You can access attributes either using the "@" shortcut notation in the above code (if there are no special characters in the attribute name), or via the GetAttributes() associative array.