I’m using vb script and MSXML2.DOMDocument to parse a xml document.
Is it possible get a particular attribute by name instead of iterating over all the attributes?
Today I am doing this
For x = 0 To (curNode.Attributes.length - 1)
sAttrName = curNode.Attributes.Item(x).nodeName
if sAttrName = 'customer' then
avalue=curNode.Attributes.Item(x).nodeValue
but I want do something like this
avalue=curNode.Attributes.Item("customer").nodeValue
Try getAttribute(), as in
curNode.getAttribute("customer").I’m assuming that curNode is an
oXMLDOMElement, though you didn’t show its type.