Loading TOC...

MarkLogic Server 11.0 Product Documentation
fn:position

fn:position() as xs:integer

Summary

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].

Example

let $x := (10, 20, 30, 40, 50)
return
$x[position() eq 2]

=> 20, which is in the second position in the sequence

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.