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

Re: Defining data in reverse chronological order

From: C Baines <cbaines@westroadchurch.org.uk>
Date: Fri, 13 Jun 2003 07:31:56 +0100
Message-ID: <000f01c33175$9f522000$99c628c3@brianwas>
To: <xmlschema-dev@w3.org>

RE: Defining data in reverse chronological orderThanks Paul

I was not aware that xsl:sort would sort xsd:date, unfortunately the client
is a Brit and would want the year last i.e. 15 01 2004. Can that format
still be sorted lexicographically or will I have to define the sequence in
the schema?

Which returns to the question - can <sequence> define the order of elements
by an attribute value common to each element without having to physically
list the elements in the order required?

Charles

----- Original Message ----- 
From: Biron,Paul V
To: C Baines ; xmlschema-dev@w3.org
Sent: Thursday, June 12, 2003 4:15 PM
Subject: 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 Friday, 13 June 2003 02:31:26 UTC

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