[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: sorting by date
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>
</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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|