array:fold-left

Evaluates the supplied function cumulatively on successive values of the supplied array.

fold-left($array as array(*), $zero as item()*, $function as function(item()*, item()*) as item()*) ➔ item()*

Arguments

 

$array

array(*)

The input array

 

$zero

item()*

The zero for the function

 

$function

function(item()*, item()*) as item()*

The function to be applied to each member of the input array

Result

item()*

Namespace

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

Links to W3C specifications

XPath 3.1 Functions and Operators

Saxon availability

Available in XPath 3.1, XSLT 3.0, and XQuery 3.1. Requires Saxon-PE or Saxon-EE. Implemented since Saxon 9.7.

Notes on the Saxon implementation

Available since Saxon 9.7.