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: 232

Filed under:
|

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

Related posts about Xml

Related posts about xpath