Find position of a node using XPath

Try:

count(a/b[.='tsr']/preceding-sibling::*)+1.

Leave a Comment