fn:position() as xs:integer
Returns the context position from the dynamic context. (See Section C.2 Dynamic Context Components[XP].) If the context item is undefined, an error is raised [err:FONC0001].
let $x := (10, 20, 30, 40, 50) return $x[position() eq 2] => 20, which is in the second position in the sequence
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.