RE: [xsl] sorting by date

Subject: RE: [xsl] sorting by date
From: "Katie McNally" <kmcnally9@xxxxxxxxxxx>
Date: Mon, 22 Oct 2001 16:27:47 -0500
The format of the dates returned in my XML is 17-Dec-2000 07:23:32. I need to display dates as 12/17/00. I am formatting the dates I display by calling the following template:

<xsl:template name="dateTemplate">
<xsl:variable name="months" select="'JanFebMarAprMayJunJulAugSepOctNovDec'"/>
<xsl:variable name="day" select="substring( ., 1, 2 )"/>
<xsl:variable name="earlier_months" select="substring-before( $months, substring( ., 4, 3 ))"/>
<xsl:variable name="month_number" select="string-length( $earlier_months ) div 3 + 1"/>
<xsl:variable name="month" select="format-number( $month_number, '00' )" />
<xsl:variable name="year" select="substring( ., 10, 2 )"/>
<xsl:value-of select="concat( $month, '/', $day, '/', $year )"/>
<xsl:text>&#x0D;&#x0A;</xsl:text>
</xsl:template>


I am displaying the dates in a table. The table can be sorted by the user by clicking on the column titles. I am able to sort the table for all of the non-date columns, but do not know how to sort the table by date.

Any suggestions?

Katie

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



Current Thread