.. _functx_sort:
===========
functx:sort
===========
Sorts a sequence of values or nodes
Description
~~~~~~~~~~~
The functx:sort function sorts a sequence of values or nodes. If nodes are
provided, their typed values are compared (if they are untyped, they are treated
like strings.) Although this can easily be accomplished with an order by clause,
calling this function makes the query less verbose because you can avoid writing
a FLWOR expression solely to sort the values.
.. list-table::
:widths: 40 60
:header-rows: 1
* - **Parameters**
- **Description**
* - seq:item()
- the sequence to sort
Examples
~~~~~~~~
.. list-table::
:widths: 50 50
:header-rows: 1
* - **XPath**
- **Results**
* - functx:sort(('c','a','b'))
- ('a', 'b', 'c')
* - functx:sort($in-xml/*)
- a b c
See Also
~~~~~~~~
.. toctree::
:titlesonly:
:glob:
* :ref:`functx_sort-as-numeric`.
* :ref:`functx_sort-case-insensitive`.
* :ref:`functx_sort-document-order`.