There are two methods:
1. use the order-by attribute
ie5 & IE6 are applicable: You can use XSL: For-each and XSL: the Order-by attribute of the apply-templates elements controls the processing sequence of the elements processed by the XSL processor. XSL: for-each select =" // book " order-by =" + name " >
XSL: For-each >
XSL: For-each select =" // book " order-by =" + name;-author>
Where, the + element is in ascending order, and the-element is in descending order. If you want to arrange multiple elements in sequence, use the; number in the middle.
2. Use the XSL: Sort Element
Internet Explorer 6 is more powerful than Internet Explorer 6. XSL: Sort also needs to be used with the XSL: For-each and XSL: Apply-templates elements, but it is no longer used as the attributes of these two elements, it appears as a child element of the two elements.
It has several important attributes:
Data-type: If the value is number, the data is sorted by number format. If the value is text, the data is sorted by text format.
Case-order: indicates whether the upper case or lower case is in front of the upper case. It can be set to upper-first or lower-first.
Lang: it can be set to a nmtoken value to indicate sorting by this language.
Order: it can be set to ascending or descending, indicating to sort in ascending or descending order.
< XSL: For-each Select = "// Book" >
< XSL: Sort Select = "Name" Data-type = "Text" />
</ XSL: For-each >