fn:function-lookup

Determines whether a function with a given name and arity is available in the context, and if so, returns a function item that can be used to call the function. The function is useful to allow fallback action when a function is not available: for example, when calling an XPath 3.0 function, the code can be conditional on whether the function is or is not available.

function-lookup($name as xs:QName, $arity as xs:integer) ➔ function(*)?

Arguments

 

$name

xs:QName

The name of the requested function

 

$arity

xs:integer

The arity of the requested function (number of arguments)

Result

function(*)?

Namespace

http://www.w3.org/2005/xpath-functions

Links to W3C specifications

XPath 3.1 Functions and Operators

Saxon availability

Available in XPath 3.0, XSLT 3.0, XQuery 3.0, and later versions. From Saxon 10, available in all editions. Implemented in Saxon-PE and Saxon-EE since Saxon 9.6.

Notes on the Saxon implementation

Available in Saxon-HE since 10; in Saxon-PE/EE since 9.6.