VBScript Find a specific node in XML(ancestor,parent nodes)

April 29, 2013 at 16:25:42
Specs: Windows 7

this is a stripped down version of my XML file: simple.xml.

<Genealogy>
<grandParent>
<name>bob</name>
<surname>Carter</surname>
<Parent>
<tel_Number>0033689765498</tel_Number>
<mobile_Phone>2</mobile_Phone>
</Parent>
</grandParent>
<grandParent>
<name>jean</name>
<surname>Wright</surname>
<Parent>
<tel_Number>0033648245432</tel_Number>
<mobile_Phone>1</mobile_Phone>
</Parent>
</grandParent>
</Genealogy>

Using Xpath expression, is it possible without no loop over all nodes to find the correct/specific node //grandParent/Parent whose properties are for example:

Parent child of grandParent
tel_Number="0033648245432" name="jean"

please could you suggest me answers which should help!. Thanks


See More: VBScript Find a specific node in XML(ancestor,parent nodes)

Report •


#1
May 1, 2013 at 11:37:41
Yeah, sure. Go for it, but if your requirements get more complex, a loop would be easier to understand.
//grandParent/Parent[tel_Number='0033648245432' and  ../name='jean']

How To Ask Questions The Smart Way


Report •
Related Solutions


Ask Question