Array Module

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.

back to top

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$arrayfor which$functionreturns true.

back to top

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.

back to top

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.

back to top

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.

back to top

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 asarray:size($array), in which each member is computed by applying$functionto the corresponding member of$array.

back to top

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.

back to top

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).

back to top

back to top

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.

back to top

array:join


Signature
array:join($arrays as array(*)*) as array(*)
Description

Concatenates the contents of several arrays into a single array.

back to top

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.

back to top

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.

back to top

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.

back to top

array:size


Signature
array:size($array as array(*)) as xs:integer
Description

Returns the number of members in the supplied array.

back to top

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.

back to top

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.

back to top

array:tail


Signature
array:tail($array as array(*)) as array(*)
Description

Returns an array containing all members except the first from a supplied array.

back to top