[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] Sorting different date formats

Subject: Re: [xsl] Sorting different date formats
From: Mukul Gandhi <mukulgandhi2003@xxxxxxxxxxx>
Date: Tue, 13 Jan 2004 16:26:59 +0000 (GMT)

Hi Allan,
  I have come up with a sorting algorithm. Hope its
correct, and suits your requirement ;)

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
<xsl:output method="xml" version="1.0"
encoding="UTF-8" indent="yes"/>
<xsl:template match="/dates">
  <xsl:variable name="RTF">
    <xsl:for-each select="endDate">
	<xsl:value-of select="translate(.,'-','')"/>
  <xsl:for-each select="msxsl:node-set($RTF)/endDate">
     <xsl:sort select="." data-type="number"/>
	<xsl:value-of select="substring(. , 1, 4 )"
/>-<xsl:value-of select="substring(. , 5, 2 )"
/>-<xsl:value-of select="substring(. , 7, 2 )" />-


 --- allan.mccluskey@xxxxxxxxxxxxxxxxx wrote: > Hi
> Could someone please show me how to perform and
> XSL:SORT on an date in this
> format? <endDate>2004-02-15</endDate>
> I have many other sorts that I need to perform so an
> explantion would also
> be much appreciated so I can fully understand how
> you do it : )
> Many thanks,
> Allan
> Important:  This e-mail is intended for the use of
> the addressee and may contain information that is
> confidential, commercially valuable or subject to
> legal or parliamentary privilege.  If you are not
> the intended recipient you are notified that any
> review, re-transmission, disclosure, use or
> dissemination of this communication is strictly
> prohibited by several Commonwealth Acts of
> Parliament.  If you have received this communication
> in error please notify the sender immediately and
> delete all copies of this transmission together with
> any attachments.
>  XSL-List info and archive: 
> http://www.mulberrytech.com/xsl/xsl-list

Yahoo! India Mobile: Download the latest polyphonic ringtones.
Go to http://in.mobile.yahoo.com

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

Current Thread