Name
<xsl:sort>
Defines a sort key for the current context. The first
<xsl:sort> defines the
primary sort key, the second <xsl:sort> defines the secondary sort
key, etc. You can have as many <xsl:sort> elements as you
need.
Category
Subinstruction.
Required Attributes
None.
Optional Attributes
selectDetermines the nodes to be sorted. You can also omit the
selectattribute and use the contents of the<xsl:sort>element to define the nodes to be sorted.langA string that defines the language used by the sort. The language codes are defined in RFC1766, available at http://www.ietf.org/rfc/rfc1766.txt. Not all processors support all languages, so check your XSLT processor’s documentation.
data-typeAn attribute that defines the type of the items to be sorted. Allowable values are
numberandtext; the default istext. An XSLT processor has the option of supporting other values as well. Sorting the values32 10 120withdata-type="text"returns10 120 32, whiledata-type="number"returns10 32 120.[2.0] In XSLT 2.0, you can specify a QName that represents some other datatype. How (or if) that value is processed can vary from one XSLT processor to another.
orderAn attribute that defines the order of the sort. Allowable values are
ascendinganddescending.case-orderAn attribute that defines the order in which upper- and lowercase letters are sorted. Allowable values are
upper-firstandlower-first.- [2.0]
collation The collation order used by this sort. For example, in Spanish, the single letter ll
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access