From http://www.w3schools.com (Copyright Refsnes Data)
XSLT Element Reference
The <xsl:sort> element is used to sort the output.
Note: <xsl:sort> is always within <xsl:for-each> or <xsl:apply-templates>.
|
<xsl:sort
select="expression" lang="language-code" data-type="text|number|qname" order="ascending|descending" case-order="upper-first|lower-first"/> |
| Attribute | Value | Description |
|---|---|---|
| select | XPath-expression | Optional. Specifies which node/node-set to sort on |
| lang | language-code | Optional. Specifies which language is to be used by the sort |
| data-type | text number qname |
Optional. Specifies the data-type of the data to be sorted. Default is "text" |
| order | ascending descending |
Optional. Specifies the sort order. Default is "ascending" |
| case-order | upper-first lower-first |
Optional. Specifies whether upper- or lowercase letters are to be ordered first |
The example below will sort the output by artist:
Example
Try it yourself » |
XSLT Element Reference
From http://www.w3schools.com (Copyright Refsnes Data)