XPath to return only elements containing the text, and not it's parents
- by julian
In this xml, I want to match, the element containing 'match' (random2 element)
<root> <random1> <random2> match </random2> <random3> nomatch </random3> </random1> </root>
ok, so far I have:
//[re:test(.,'match','i')] (with re in the proper namespace)
this returns random2, random1 and root... I would like to get only "random2"
any ideas?