
xdmp:current-position() as xs:integer
Returns the position of the current item.
This function is only available in XSLT; it is not available in XQuery.
xquery version "1.0-ml";
xdmp:xslt-eval(
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xdmp="http://marklogic.com/xdmp">
<xsl:template match="/">
<xsl:value-of select="xdmp:current-position()"/>
</xsl:template>
</xsl:stylesheet>,
document{<foo>hello there</foo>})
=> 1
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.