XPath to return only elements containing the text, and not it's parents
Posted
by julian
on Stack Overflow
See other posts from Stack Overflow
or by julian
Published on 2010-06-08T01:11:08Z
Indexed on
2010/06/08
1:22 UTC
Read the original article
Hit count: 257
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?
© Stack Overflow or respective owner