I am new to XML data and VBScript - Resources Ive found have not worked for me. I am trying to get the value from the XML when there is a match for a country.
E.g. Search for UNITED KINGDOM and retrieve the value.
Can someone please help me solve this in VBScript? Thanks!!
My XML file is below...
<root>
<!--
************************
::List:: COUNTRY::
************************
-->
<COUNTRY>
<Name>UNIED KINGDOM</Name>
<Region>E</Region>
<SETTING>I want this value</SETTING>
<COUNTRYCODE>GB</COUNTRYCODE>
</COUNTRY>
This is the code I tried from TechNet
Set xmlDoc = CreateObject( "Microsoft.XMLDOM" )
xmlDoc.Async = "False"
xmlDoc.Load( "Data.xml")
strQuery = "Root[COUNTRY = 'UNITED KINGDOM']/SETTING"
Set colNodes = xmlDoc.selectNodes( strQuery )
For Each objNode in colNodes
Msgbox objNode.text
Next