XSL:Sort By Date
Monday, March 2nd, 2009The following should do the work
<xsl:apply-templates select="[some repeating datum]"> <xsl:sort order="descending" select="substring(//somedate,7,4)"> <!-- year--> <xsl:sort order="descending" select="substring(//somedate,4,2)"> <!-- month--> <xsl:sort order="descending" select="substring(//somedate,1,2)"> <!-- day--> </xsl:apply-templates>
This assumes the date is in the form dd/mm/yyyy: the seperators could be different as they are ignored anyway based on the substring.
The important thing to realise here is that the <xsl:sort> functions do not do anything APART from sort, so there is nothing to see at this point if debugging
The work is done in a receiving
<xsl:template match="[match repeating datum]"> ... </xsl:template>
The
