<xsl:sort>
<xsl:sort> 元素為 <xsl:apply-templates> 或 <xsl:for-each> 選擇的節點定義一個排序鍵,並決定它們的處理順序。
語法
xml
<xsl:sort
select=EXPRESSION
order="ascending" | "descending"
case-order="upper-first" | "lower-first"
lang=XML:LANG-CODE
data-type="text" | "number" />
必需屬性
無。
可選屬性
select-
使用 XPath 表示式指定要排序的節點。
order-
指定節點是按
ascending(升序)還是descending(降序)進行處理。預設值為ascending。 case-order-
指示優先對大寫字母還是小寫字母進行排序。允許的值為
upper-first和lower-first。 lang-
指定排序所使用的語言。
data-type-
定義是按字母順序還是按數字順序對項進行排序。允許的值為
text和number,其中text為預設值。
型別
子指令,始終出現在 <xsl:for-each> 的子元素中,必須出現在模板本身或 <xsl:apply-templates> 之前。
規範
XSLT, section10。
Gecko 支援情況
支援。