xdmp:function( $function as xs:QName?, [$module-path as xs:string?] ) as xdmp:function
Returns a function value as an xdmp:function
type.
You can return an xdmp:function
from an expression or
a function. You can execute the function referred to by an
xdmp:function
by passing the xdmp:function
value to
xdmp:apply
. If the module-path ends with a file
extension matching the ones configured for
application/vnd.marklogic-javascript
in your
MarkLogic Mimetypes configuration, and the function's namespace URI is
empty, the module is considered to be JavaScript. In this case, the function
parameter can be empty.
xquery version "1.0-ml"; xdmp:function(xs:QName("fn:empty"))
xquery version "1.0-ml"; declare namespace admin="http://marklogic.com/xdmp/admin"; xdmp:function(xs:QName("admin:get-configuration"), "/MarkLogic/admin.xqy")
xquery version "1.0-ml"; let $function := xdmp:function(xs:QName("fn:concat")) return xdmp:apply($function, "hello", " world") => hello world