http://www.w3.org/2005/xpath-functions/array
This module is statically bound to the prefix "array".
- Description
An array is an additional kind of item. An array of size N is a mapping from the integers (1 to N) to a set of values, called the members of the array, each of which is an arbitrary sequence. Because an array is an item, and therefore a sequence, arrays can be nested.
The functions defined in this section use a conventional namespace prefix array, which is assumed to be bound to the namespace URI http://www.w3.org/2005/xpath-functions/array.
- Functions
array:append
- Signature
array:append($array as array(*), $appendage as item()*) as array(*)
- Description
Returns an array containing all the members of a supplied array, plus one additional member at the end.
array:filter
- Signature
array:filter($array as array(*), $function as function(item()*) as xs:boolean) as array(*)
- Description
Returns an array containing those members of the
$array
for which$function
returns true.
array:flatten
- Signature
array:flatten($input as item()*) as item()*
- Description
Replaces any array appearing in a supplied sequence with the members of the array, recursively.
array:fold-left
- Signature
array:fold-left($array as array(*), $zero as item()*, $function as function(item()*, item()*) as item()*) as item()*
- Description
Evaluates the supplied function cumulatively on successive members of the supplied array.
array:fold-right
- Signature
array:fold-right($array as array(*), $zero as item()*, $function as function(item()*, item()*) as item()*) as item()*
- Description
Evaluates the supplied function cumulatively on successive values of the supplied array.
array:for-each
- Signature
array:for-each($array as array(*), $action as function(item()*) as item()*) as array(*)
- Description
Returns an array whose size is the same as
array:size($array)
, in which each member is computed by applying$function
to the corresponding member of$array
.
array:for-each-pair
- Signature
array:for-each-pair($array1 as array(*), $array2 as array(*), $function as function(item()*, item()*) as item()*) as array(*)
- Description
Returns an array obtained by evaluating the supplied function once for each pair of members at the same position in the two supplied arrays.
array:get
- Signature
array:get($array as array(*), $position as xs:integer) as item()*
- Description
Returns the value at the specified position in the supplied array (counting from 1).
array:head
- Signature
array:head($array as array(*)) as item()*
- Description
Returns the first member of an array, that is
$array(1)
.
array:insert-before
- Signature
array:insert-before($array as array(*), $position as xs:integer, $member as item()*) as array(*)
- Description
Returns an array containing all the members of the supplied array, with one additional member at a specified position.
array:join
- Signature
array:join($arrays as array(*)*) as array(*)
- Description
Concatenates the contents of several arrays into a single array.
array:put
- Signature
array:put($array as array(*), $position as xs:integer, $member as item()*) as array(*)
- Description
Returns an array containing all the members of a supplied array, except for one member which is replaced with a new value.
array:remove
- Signature
array:remove($array as array(*), $positions as xs:integer*) as array(*)
- Description
Returns an array containing all the members of the supplied array, except for themembers at specified positions.
array:reverse
- Signature
array:reverse($array as array(*)) as array(*)
- Description
Returns an array containing all the members of a supplied array, but in reverse order.
array:size
- Signature
array:size($array as array(*)) as xs:integer
- Description
Returns the number of members in the supplied array.
array:sort
- Signature
array:sort($array as array(*)) as array(*)
array:sort($array as array(*), $collation as xs:string?) as array(*)
array:sort($array as array(*), $collation as xs:string?, $key as function(item()*) as xs:anyAtomicType*) as array(*)- Description
Returns an array containing all the members of the supplied array, sorted according to the value of a sort key supplied as a function.
array:subarray
- Signature
array:subarray($array as array(*), $start as xs:integer) as array(*)
array:subarray($array as array(*), $start as xs:integer, $length as xs:integer) as array(*)- Description
Returns an array containing all members from a supplied array starting at a supplied position, up to a specified length.
array:tail
- Signature
array:tail($array as array(*)) as array(*)
- Description
Returns an array containing all members except the first from a supplied array.