Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 18th, 2008, 12:20 AM
Registered User
 
Join Date: Mar 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default sorting on date column in XSLT

Hi
I want to sort my data using XSL. I am using
<xsl:sort select="*[name(.)=$SortCol]" order="{$SortOrder}" data- type="{$dataType}"/>
command 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

 
Old March 18th, 2008, 07:19 AM
Friend of Wrox
 
Join Date: Nov 2007
Posts: 1,243
Thanks: 0
Thanked 245 Times in 244 Posts
Default

With XSLT 2.0 there is support for the xs:date data type but its format is yyyy-mm-dd so you need to reorder your date strings.

With XSLT 1.0 you can only sort numbers or strings so again you need to reorder your date strings, it is possible to compare yyyymmdd as a string or number I think.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Sorting a column yogeshyl Excel VBA 1 December 10th, 2007 07:09 PM
Dynamic column sorting victorcorey XSLT 1 October 31st, 2007 05:40 PM
Column Sorting/Formatting in MS Datagrid! ao7711 C# 1 July 13th, 2006 02:32 PM
Sorting lists by clicking column labels isme XSLT 0 March 15th, 2006 04:40 PM
sorting a column alphabetically Adam H-W SQL Server 2000 8 November 11th, 2003 09:29 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.