MarkLogic 10 Product Documentation
xdmp:current-position

xdmp:current-position() as xs:integer

Summary

Returns the position of the current item.

This function is only available in XSLT; it is not available in XQuery.

Example

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
Powered by MarkLogic Server | Terms of Use | Privacy Policy