Loading TOC...

MarkLogic Server 11.0 Product Documentation
xdmp:apply

xdmp:apply(
   $function as xdmp:function,
   [$params-1-to-N as item()*]
) as item()*

Summary

Applies an xdmp:function with the given parameters.

Parameters
function The xdmp:function value to be applied.
params-1-to-N The parameters to pass into the specified function value. Specify one parameter for each parameter that the specified function takes, with the first parameter corresponding to the first parameter in the specified function's signature, the second parameter corresponding to the second, and so on. Omit this parameter if the specified function takes no parameters.

Example

  let $function := xdmp:function(xs:QName("fn:empty"))
  return
    xdmp:apply($function, ())

  => true

Example

  let $function := xdmp:function(xs:QName("fn:concat"))
  return
    xdmp:apply($function, "hello", " world")

  => hello world

Example

  let $function := xdmp:function(xs:QName("fn:current-date"))
  return
    xdmp:apply($function)

  => 2009-02-14-08:00  (or whatever is the current date)

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