SAXONICA

Saxon Documentation
Full Contents
About Saxon
Changes in this Release
Conditions of Use
Using XSLT 2.0
Using XQuery
Handling Source Documents
XML Schema Processing
The XPath API
Standards Conformance
Extensibility
Saxon Extensions
Sample Saxon Applications
The Saxon SQL Extension
XSLT Elements
| Introduction
| xsl:analyze-string
| xsl:apply-imports
| xsl:apply-templates
| xsl:attribute
| xsl:attribute-set
| xsl:call-template
| xsl:character-map
| xsl:choose
| xsl:comment
| xsl:copy
| xsl:copy-of
| xsl:decimal-format
| xsl:document
| xsl:element
| xsl:fallback
| xsl:for-each
| xsl:for-each-group
| xsl:function
| xsl:if
| xsl:include
| xsl:import
| xsl:import-schema
| xsl:key
| xsl:matching-substring
| xsl:message
| xsl:namespace
| xsl:namespace-alias
| xsl:next-match
| xsl:non-matching-substring
| xsl:number
| xsl:otherwise
| xsl:output
| xsl:output-character
| xsl:param
» | xsl:perform-sort
| xsl:preserve-space
| xsl:processing-instruction
| xsl:result-document
| xsl:sequence
| xsl:sort
| xsl:strip-space
| xsl:stylesheet
| xsl:template
| xsl:text
| xsl:value-of
| xsl:variable
| xsl:when
| xsl:with-param
| Literal Result Elements
XPath 2.0 Expression Syntax
Function Library
XSLT Patterns

# xsl:perform-sort

The `xsl:perform-sort` instruction takes a sequence as its input and produces a sorted sequence as its output.

The input sequence may be specified either using the `select` attribute, or using the instructions contained within the `xsl:perform-sort` instruction.

The sort criteria are specified using `xsl:sort` elements as children of `xsl:perform-sort`, in the usual way.

For example:

    <xsl:perform-sort select="//BOOK">
        <xsl:sort select="author/last-name"/>
        <xsl:sort select="author/first-name"/>
    </xsl:perform-sort>

It's often useful to use `xsl:perform-sort` inside a stylesheet function; the function can return the sorted sequence as its result, and can be invoked directly from an XPath expression.

Next