[xsl] Question on storing Dates for Calendar Items

Subject: [xsl] Question on storing Dates for Calendar Items
From: Gollwitzer Brian Contr ESC/JS <Brian.Gollwitzer@xxxxxxxxxxxxxx>
Date: Tue, 20 Mar 2001 19:41:45 -0500
I'm currently using ODBC and ASP to serve up calendar information
in a table/list format.  The table consists of two columns, 
Event Description and Event Date and is sorted by Event Date.

The Event Date is stored in the DB as a Date Data Type.

The HTML Outpout looks like below

<table>
<th>Event Description</th><th>Event Date</th>
<tr><td>Event 1</td><td12-Febr-01</td></tr>
<tr><td>Event 2</td><td>14-Mar-01</td></tr>
<tr><td>Event 3</td><td>18-Apr-01</td></tr>
</table>

I would like to recreate this using XML and XSL just as a sample
to try and learn the technology.

Using ASP I create the XML file and it looks like below.

<?xml version='1.0'?>
<calendar_items>
<item>
<description>Event 1</description>
<date>12-Feb-01</date>
</item>
<item>
<description>Event 2</description>
<date>14-Mar-01</date>
</item>
<item>
<description>Event 3</description>
<date>18-Apr-01</date>
</item>
</calendar_items>

----->However<---------

If I perform an xsl:sort it has no idea the information is a date and
incorrectly sorts the information.

--------->So<----------

What I'm wondering is 

1.  What is a good way to store this date information so it can be easily
sorted.

Would it be worth it to break the date into Day/Month/Year and xsl:sort on
Year, then Month, then Day?


I know I could just sort the data server-side before writing it to the XML
file and
xsl:for-each running through them in order knowing they are already sorted
but
I'd like ot know if there is another way.


I'm new to XML and XSL to if I'm completely missing some fundamental concept
that would make this a whole lot easier please let me know and I'll read up
on it.

I'm using IE 5 and msxml 3 in replace mode.

I checked the archives of the list and didn't find much discussion on
sort;dates

Thank you in advance for your help,


> Brian Gollwitzer
> Joint STARS Program Office
> DSN: 478-6769 / Comm (781) 377-3952
> FAX: 478-1547 / Comm (781) 377-1547
> Email: Gollwitzerb@xxxxxxxxxxxxxx
> 

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


Current Thread