RE: [xsl] Date-sorting

Subject: RE: [xsl] Date-sorting
From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx>
Date: Wed, 30 Jan 2002 13:21:27 -0000
<xsl:for-each select="OBX">
  <xsl:sort select="substring(@ObervationDT,1,10)"/>
  <xsl:sort select="@OBS"/>

But it will output g before h.

Mike Kay

> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Asim Tozlu
> Sent: 30 January 2002 12:56
> To: A XSL (E-Mail)
> Subject: [xsl] Date-sorting
> 
> 
> Hi,
> 
> i have this XML:
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <tdObsResults>
> 	<OBX ID="{550D-4965-8E7A-C2F01B8CC79" State="1"
> ObservationDT="2001-11-08T08:00:00" OBS="a"/>
> 	<OBX ID="{8A3F7D3E-550D-4965-C2F01B8CC79" State="1"
> ObservationDT="2001-12-08T08:00:00" OBS="b"/>
> 	<OBX ID="{8A3F7D3E-550D-8E7A-C2F01B8CC79" State="1"
> ObservationDT="2001-11-11T08:00:00" OBS="c"/>
> 	<OBX ID="{8A3F7D3E-550D-C2F01B8CC79" State="1"
> ObservationDT="2001-12-09T08:00:00" OBS="d"/>
> 	<OBX ID="{8A3F7D3E-550D-4965-8E7A-C2F01B8CC79" State="1"
> ObservationDT="2001-10-08T08:00:00" OBS="e"/>
> 	<OBX ID="{8A3F7D3E-550D-4965-C2F01B8CC79" State="1"
> ObservationDT="2001-09-08T08:00:00" OBS="f"/>
> 	<OBX ID="{8A3F7D3E-550D-4965-8E7A" State="1"
> ObservationDT="2001-11-08T18:00:00" OBS="g"/>
> 	<OBX ID="{550D-4965-8E7A-C2F01B8CC79" State="1"
> ObservationDT="2001-11-08T10:00:00" OBS="h"/>
> </tdObsResults>
> 
> But i want this sort Result (Sort-Tag is ObservationDT):
> 
> 08.09.2001 	f
> 08.10.2001 	e
> 08.11.2001 	a
> 08.11.2001 	h
> 08.11.2001 	g
> 11.11.2001	c
> 08.12.2001	b
> 09.12.2001 	d
> 	
> 
> How can i sort this XML?
> 
> Thanks
> 
> with friendly regards
> 
> Asim
> 
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 

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


Current Thread