array:sort

Returns an array containing all the members of the supplied array, sorted according to the value of a sort key supplied as a function, using the supplied collation.

sort($array as array(*)) ➔ array(*)

Arguments

 

$array

array(*)

The input array

Result

array(*)

sort($array as array(*), $collation as xs:string?) ➔ array(*)

Arguments

 

$array

array(*)

The input array

 

$collation

xs:string?

The collation

Result

array(*)

sort($array as array(*), $collation as xs:string?, $key as function(item()*) as xs:anyAtomicType*) ➔ array(*)

Arguments

 

$array

array(*)

The input array

 

$collation

xs:string?

The collation

 

$key

function(item()*) as xs:anyAtomicType*

The sort key

Result

array(*)

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. From Saxon 10, available in all editions. Implemented in Saxon-PE and Saxon-EE since Saxon 9.7. Available for all platforms.

Notes on the Saxon implementation

Available in Saxon-HE from Saxon 10; in Saxon-PE/EE since 9.7. Signature changed to add $collation argument from 9.7.0.8.