有一个不使用任何扩展名的“简单”答案:将行值拆分为卡盘并对其进行排序。
<xsl:template match="root">
<xsl:copy>
<xsl:apply-templates select="ROW">
<xsl:sort select="substring-before(concat(., '.'), '.')" data-type="number"/>
</xsl:apply-templates>
</xsl:copy>
</xsl:template>
<xsl:template match="ROW">
<xsl:param name="prefix" select="''"/>
<xsl:choose>
<!-- end of recursion, there isn't any more ROW with more chucks -->
<xsl:when test=". = substring($prefix, 1, string-length($prefix)-1)">
<xsl:copy-of select="."/>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="chuck" select="substring-before(concat(substring-after(., $prefix), '.'), '.')"/>
<!-- this test is for grouping ROW with same prefix, to skip duplicates -->
<xsl:if test="not(preceding-sibling::ROW[starts-with(., concat($prefix, $chuck))])">
<xsl:variable name="new-prefix" select="concat($prefix, $chuck, '.')"/>
<xsl:apply-templates select="../ROW[starts-with(., $new-prefix) or . = concat($prefix, $chuck)]">
<xsl:sort select="substring-before(concat(substring-after(., $new-prefix), '.'), '.')" data-type="number"/>
<xsl:with-param name="prefix" select="$new-prefix"/>
</xsl:apply-templates>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:template>