Loading TOC...

fn.head

fn.head(
   $seq as Sequence
) as String?

Summary

Returns the first item in a sequence. For more details, see XPath 3.0 Functions and Operators.

Parameters
$seq A Sequence of items. A single item is treated as a Sequence of one. An Array is treated as a single item -- if an Array is passed in, the Array is returned. To make a Sequence from an Array see xdmp.arrayValues.

Example

fn.head(xdmp.arrayValues([1,2,3]))
=> 1

Comments

  • The return type is `String?`, but in XQuery it is `item()?`. Sounds like a bug to me...
  • What's the second parameter? The F&O spec contains only one arity, and I cannot make sense of the `arg` description above...
Powered by MarkLogic Server 7.0-4.1 and rundmc | Terms of Use | Privacy Policy