Loading TOC...

xdmp:current-last

xdmp:current-last() as xs:integer

Summary

Returns the size of the current node list.

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="foo">
   <xsl:value-of select="xdmp:current-last()"/>
 </xsl:template>
</xsl:stylesheet>,
document{<foo>
           <a>hello</a>
           <b>there</b>
         </foo>})


=> 1

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