RE: Defining data in reverse chronological order

> -----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