03-07-2012 12:54 PM
Given this XML structure.
<root>
<C cmd="a">
<T>text 1</T>
</C>
<C cmd="b">
<T>text 2</T>
</C>
<C cmd="c">
<T>text 3</T>
</root>
How would I write an xpath statement to return the <C> cmd attribute for a single found <T> element?
For example if text 2 is found then return "b"... if text 1 is found then return "a".. you get the idea.. I need the parent attribute of a found child element.
TIA
Solved! Go to Solution.
03-08-2012 02:25 PM
Hello FunkyMonk,
This website talks about how to select the parent of an element in an XML expression:
http://www.tizag.com/xmlTutorial/xpathparent.php
Does that answer your question?