fn:function-name

Returns the name of the function identified by a function item.

Signature

fn:function-name($func as function(*)) as xs:QName?

Properties

This function is deterministic, context-independent, focus-independent, and higher-order.

Rules

If $func refers to a named function, fn:function-name($func) returns the name of that function.

Otherwise ($func refers to an anonymous function), fn:function-name($func) returns an empty sequence.

The prefix part of the returned QName is implementation-dependent.

Examples

The expression fn:function-name(fn:substring#2) returns fn:QName("http://www.w3.org/2005/xpath-functions", "fn:substring"). (The namespace prefix of the returned QName is not predictable.)

The expression fn:function-name(function($node){count($node/*)}) returns ().