Makes a dynamic call on a function with an argument list supplied in the form of an array.
The result of the function is obtained by invoking the supplied function
$function with arguments
taken from the members of the supplied array
$array. The first argument of the function call is the first
$array, the second argument is the second member of
$array, and so on.
The arity of the supplied function
$function must be the same as the size of the array
The effect of calling
fn:apply($f, [$a, $b, $c, ...]) is the same as the effect of the dynamic function call
$f($a, $b, $c, ....). For example, the function conversion rules are applied to the supplied arguments
in the usual way.
fn:apply(fn:concat#3, ["a", "b", "c"]) returns
fn:apply($f, array:subarray(["a", "b", "c", "d", "e", "f"], 1, fn:function-arity($f)))
calls the supplied function
$f supplying the number of arguments required by its arity.
A dynamic error is raised if the arity of the function
$function is not the same as the size of the
The function is useful where the arity of a function item is not known statically.