[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: XSL month sorting (chronologically)

Subject: Re: XSL month sorting (chronologically)
From: "murli bk" <bkmurali@xxxxxxxxxxx>
Date: Fri, 12 Apr 2002 12:11:52
bk murli
I tried out Michael's suggestion using string-length. I am getting "Whitespace required before attributes" exception. What could be the problem.

The sorting is done first on the year, then on the month and then on the day.

The xml file I use is

<?xml version="1.0" encoding="UTF-8"?>
   <date>10 Apr 2002</date>
     <date>14 Apr 2001</date>
     <date>09 Mar 2002</date>
     <date>08 Mar 2003</date>
     <date>01 Jan 2002</date>
     <date>11 Feb 2002</date>

The xsl script(which gives a html output) I used is

<xsl:stylesheet version="1.0"

<xsl:template match="/">
   <xsl:for-each select="eventlog">


  	    EventLog Information

  <xsl:for-each select="eventlog">
  <TABLE  border="1">



<xsl:for-each select="event">
<xsl:sort select="substring(date, 8, 4)" data-type="number" />
<xsl:sort select="string-length(substring-before("JanFebMarAprMayJunJulAugSepOctNovDec", substring("date",4,3))" data-type="number" />
<xsl:sort select="substring(date, 1, 2)" data-type="number" />

          <TD><xsl:value-of select="date"/></TD>
	   <TD><xsl:value-of select="data"/></TD>







Join the world?s largest e-mail service with MSN Hotmail. http://www.hotmail.com

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

Current Thread


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.