Subject: Re: [xsl] Sorting with Different Sort Keys From: Abel Braaksma <abel.online@xxxxxxxxx> Date: Fri, 19 Oct 2007 11:14:37 +0200 |
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="input">
<xsl:apply-templates select="data">
<!-- sort the 'seite' first -->
<xsl:sort select="matches(., '\s*seite', 'i')" order="descending" />
<!-- sort the non-correct ones last -->
<xsl:sort select="not(matches(., '^\d+$'))" order="ascending" />
<!-- sort everything by its numeric value -->
<xsl:sort select="replace(., '\D', '')" order="ascending" data-type="number" />
</xsl:apply-templates>
</xsl:template>
<xsl:template match="data">
<xsl:sequence select="' ', text()"/>
</xsl:template>
</xsl:stylesheet>
Cheers, -- Abel
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Sorting with Different So, Abel Braaksma | Thread | Re: [xsl] Sorting with Different So, Abel Braaksma |
Re: [xsl] Sorting with Different So, Abel Braaksma | Date | Re: [xsl] Sorting with Different So, Abel Braaksma |
Month |