This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: Question on storing Dates for Calendar Items
- To: <xsl-list at lists dot mulberrytech dot com>
- Subject: RE: [xsl] Question on storing Dates for Calendar Items
- From: "Tim Watts" <timw at 3d3 dot com>
- Date: Fri, 23 Mar 2001 16:23:31 +1100
- Reply-To: xsl-list at lists dot mulberrytech dot com
I like your idea of breaking the date into Day/Month/Year and xsl:sort on
Year, then Month, then Day?
To sort the months, a way to make this easier would be to assign each a
numeric attribute
<month name="Jan" value="1" />
<month name="Feb" value="2" />
<month name="Mar" value="3" />
<month name="Apr" value="4" />
<month name="May" value="5" />
<month name="Jun" value="6" />
<month name="Jul" value="7" />
<month name="Aug" value="8" />
<month name="Sep" value="9" />
<month name="Oct" value="10" />
<month name="Nov" value="11" />
<month name="Dec" value="12" />
I would be interested to see other ways of doing this, and hope you get a
few posts with other methods
Tim Watts
-----Original Message-----
From: owner-xsl-list@lists.mulberrytech.com
[mailto:owner-xsl-list@lists.mulberrytech.com]On Behalf Of Gollwitzer
Brian Contr ESC/JS
Sent: Wednesday, 21 March 2001 11:42 AM
To: 'XSL-List@lists.mulberrytech.com'
Subject: [xsl] Question on storing Dates for Calendar Items
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.
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>
</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.
> Brian Gollwitzer
> Joint STARS Program Office
> DSN: 478-6769 / Comm (781) 377-3952
> FAX: 478-1547 / Comm (781) 377-1547
> Email: Gollwitzerb@hanscom.af.mil
>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list