Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sorting date types

Status
Not open for further replies.

divinyl

IS-IT--Management
Nov 2, 2001
163
GB
Hi all,

I'm an XSLT newbie, and I need some assistance sorting dates in XSLT. I know you need to convert them to date or string type, but i cannot figure out exactly how to do it. Would someone be able to provide some sample code?

Thanks in advance!

Divinyl
 
If your date values are stored in the correct XML format, then sorting is easy (ISO-8601 format). If they are not stored correctly, then you will need to fiddle with them using the substring() XSLT function, concatenating them into shape.

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
Hi

Thanks for responding. Well, the format of the date is : 2004-11-29 (so yyyy-mm-dd). This is the right format isn't it?
I try to do a regular sort, so:
<xsl:sort order="ascending" select="PROJECT.ENDDATE" />

but it seems to sort on only the month, and in the reverse order, so descending! HELP!

I didn't write the original XML files, but the encoding on the page itself is iso-8869-1. Does that make a difference?

Thanks

Divinyl
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top