xsl:perform-sort

Takes a sequence as its input and produces a sorted sequence as its output.

Category: instruction
Content: ( xsl:sort+ , sequence-constructor )
Permitted parent elements: any XSLT element whose content model is sequence constructor; any literal result element

Attributes

select?

expression

Expression to specify the input sequence (alternatively may be specified using the instructions contained within the xsl:perform-sort instruction).

Details

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

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.

Examples

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

Links to W3C specifications

XSLT 2.0 Specification

XSLT 3.0 Specification

See also

xsl:apply-templates

xsl:for-each

xsl:sort