W3C home > Mailing lists > Public > xmlschema-dev@w3.org > June 2003

RE: Defining data in reverse chronological order

From: Biron,Paul V <Paul.V.Biron@kp.org>
Date: Thu, 12 Jun 2003 08:15:23 -0700
Message-Id: <8904C60CACA7D51191BC00805FEAAF430153F532@crdc-exch-7.crdc.kp.org>
To: C Baines <cbaines@westroadchurch.org.uk>, xmlschema-dev@w3.org
> -----Original Message-----
> From: C Baines [mailto:cbaines@westroadchurch.org.uk] 
> Sent: Thu, Jun 12, 2003 04:09
> To: xmlschema-dev@w3.org
> 
> I am writing an XMLschema to validate XML output from a job 
> opportunity database.
> 
> The client wants lists of opportunities resulting from an 
> interface search to be displayed in reverse chronological 
> order depending on the <date> of each entry to the database.
> 
> I don't think this can be achieved in the transformation 
> because xsl:sort does not sort dates. Can this be achieved 
> via the schema e.g. can an attribute be included within  
> <sequence> to define elements in date order:
> 
> <sequence sort="xsd:date">
> <element name="opportunity" type="opportunityType" minOccurs="1"
> maxOccurs="unbounded"/>
> </sequence>

Although XSLT 1.0 xsl:sort isn't datatype aware, it is a fortuitous property of the lexical representation of xs:date (borrowed from ISO 8601) that a lexicographic sort also produces a chronological sort.

pvb
Received on Thursday, 12 June 2003 11:20:13 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:15:11 UTC