I have the following XML that has been return from a SOAP API:
<?xml version="1.0" encoding="UTF-8"?>
<results>
<result>
<field name="accountnumber" value="100035" />
<field name="occupantcode" value="11" />
<field name="otherfield" value"do not care about this one" />
</result>
</results>
I am trying to load the account number into a variable called AcctNum, and the other one into OccCode using VBScript. I am very new to XPath queries. I am trying something like this:
Set ANumNode = xmlResponse.SelectNodes("//results/result/field[@accountnumber]")
For Each objSite In ANumNode
AcctNum = objSite.SelectSingleNode("accountnumber").Text
Next
but of course that is blowing up spectacularly. There are actually about 20 field nodes in the response, of which I am only concerned with about 4 of them. I cannot change the format of the XML being outputted.