Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
XML
data.xmlanalysis
mappoint.webservice
msf
msxml-webrelease
netmyservices.sdk
passport.sdk
soap
soapsdk
uddi.general
uddi.programming
uddi.specification
xml
xmlsqlwebrelease
xsl
  
 
date: Mon, 17 Mar 2008 21:56:23 -0700 (PDT),    group: microsoft.public.xsl        back       


sorting on date column in XSL   
hi
I want to sort my data using XSl. I am using
<xsl:sort  select="*[name(.)=$SortCol]" order="{$SortOrder}" data-
type="{$dataType}"/>
this xommand for sorting

But one of my column is of type date. so how do I specify the datatype
for date. My date format is dd mon yyyy
date: Mon, 17 Mar 2008 21:56:23 -0700 (PDT)   author:   Palwi

Re: sorting on date column in XSL   
On Mar 18, 9:56 am, Palwi  wrote:
> hi
> I want to sort my data using XSl. I am using
> <xsl:sort  select="*[name(.)=$SortCol]" order="{$SortOrder}" data-> type="{$dataType}"/>
> this xommand for sorting
>
> But one of my column is of type date. so how do I specify the datatype
> for date. My date format is dd mon yyyy

1. you are using XSL 1.0 or 2.0?
2. If you are using xsl 1.0  this doesn't have datatypes like date,
time, integer, etc.

    You split the date and sort it. e.g

<xsl:sort select="substring-before(' ',date)" data-type="number"/>

Regards,
Balaji. M
date: Mon, 17 Mar 2008 23:04:49 -0700 (PDT)   author:   Balaji

Re: sorting on date column in XSL   
Palwi wrote:

> I want to sort my data using XSl. I am using
> <xsl:sort  select="*[name(.)=$SortCol]" order="{$SortOrder}" data-
> type="{$dataType}"/>
> this xommand for sorting
> 
> But one of my column is of type date. so how do I specify the datatype
> for date. My date format is dd mon yyyy

XSLT 2.0 supports the xs:date data type but it has the format yyyy-mm-dd 
so you would need to reorder your date strings.
With XSLT 1.0 you need to sort numbers or strings, you can do that also 
by reordering your date strings in the format yyyymmdd.

-- 

	Martin Honnen --- MVP XML
	http://JavaScript.FAQTs.com/
date: Tue, 18 Mar 2008 12:45:39 +0100   author:   Martin Honnen

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us