fredmartinmaine
IS-IT--Management
<Properties>
There are one or more <Property> nodes.
I'd like to work with a <Property> but only want the one with a specific location number in it. Once I find that <Property> I'll be extracting the text from the child nodes, such as <BldgCost>.
I'm having trouble finding syntax that works. This does not:
Set node = objDoc.SelectSingleNode("Properties/Property[LocationNumber/text()='023']")
MsgBox(node.text)
Result is 'Object required: node' from the MsgBox line. I assume that means there's no error in the Select line, it's just not finding anything.
As well, when I get this working, that ='023' will need to be a variable, like:
Set node = objDoc.SelectSingleNode("Properties/Property[LocationNumber/text()=LocNum]")
Mr. Google isn't helping me find an example that works with VBScript.
<Property>
<LocationNumber>023</LocationNumber>
<BuildingNumber>001</BuildingNumber>
<BldgCost>234500</BldgCost>
<BldgSqFt>1200</BldgSqFt>There are one or more <Property> nodes.
I'd like to work with a <Property> but only want the one with a specific location number in it. Once I find that <Property> I'll be extracting the text from the child nodes, such as <BldgCost>.
I'm having trouble finding syntax that works. This does not:
Set node = objDoc.SelectSingleNode("Properties/Property[LocationNumber/text()='023']")
MsgBox(node.text)
Result is 'Object required: node' from the MsgBox line. I assume that means there's no error in the Select line, it's just not finding anything.
As well, when I get this working, that ='023' will need to be a variable, like:
Set node = objDoc.SelectSingleNode("Properties/Property[LocationNumber/text()=LocNum]")
Mr. Google isn't helping me find an example that works with VBScript.