Loading TOC...

fn.functionLookup

fn.functionLookup(
   $name as xs.QName,
   $arity as Number
) as function(*)?

Summary

Returns a function with the given name and arity, or the empty sequence if none exists. You can use the returned function reference with xdmp.apply. For more details, see XPath 3.0 Functions and Operators.

Parameters
$name The QName of the function.
$arity The number of arguments the function takes.

Example

var fn = fn.functionLookup(
           fn.QName('http://www.w3.org/2005/xpath-functions','concat'),4);
xdmp.functionSignature(fn);
=> 'function(xs:anyAtomicType?, xs:anyAtomicType?, xs:anyAtomicType?, xs:anyAtomicType?) as xs:string'

Example

var fn = fn.functionLookup(
           fn.QName('http://www.w3.org/2005/xpath-functions','concat'),4);
xdmp.apply(fn, 'here', 'is', 'an', 'example');
==> 'hereisanexample'

Comments

    Powered by MarkLogic Server 7.0-4.1 and rundmc | Terms of Use | Privacy Policy