Take the 2-minute tour ×

My sample input XML is:


I am suppose to select a node "b" whose position is the value of a variable, how to use the value of variable to test the position of a node?

Best Reagards,

share|improve this question

2 Answers 2

up vote 34 down vote accepted

you can use this:


position() is 1 based


share|improve this answer

The following should work:


And if it doesn't, try:

share|improve this answer

Your Answer


