To do this in pure XSLT 1.0, you will need to do it the pedestrian way:
<xsl:sort select="substring-before(code, '_')" data-type="number"/>
<xsl:sort select="substring-before(substring-after(code, '_'), '_')" data-type="number"/>
<xsl:sort select="substring-before(substring-after(substring-after(code, '_'), '_'), '_')" data-type="number"/>
<xsl:sort select="substring-after(substring-after(substring-after(code, '_'), '_'), '_')" data-type="number"/>
If your processor happens to support the EXSLT str:tokenize()
extension function, you could make it a bit more elegant:
<xsl:sort select="str:tokenize(code, '_')[1]" data-type="number"/>
<xsl:sort select="str:tokenize(code, '_')[2]" data-type="number"/>
<xsl:sort select="str:tokenize(code, '_')[3]" data-type="number"/>
<xsl:sort select="str:tokenize(code, '_')[4]" data-type="number"/>
Untested, because no code was provided.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…