Lists Home |
Date Index |
xs:duration is broken and should never have made it into the W3C XML Schema REC in the first place. Simple question; Is an xs:duration representing 3 months equivalent to an xs:duration representing 90 days?
On the other hand, xf:yearMonthDuration and xf:dayTimeDuration are fully ordered and can be sorted in the manner you described.
From: Jeni Tennison [mailto:email@example.com]
Sent: Sat 9/28/2002 9:18 AM
Cc: Jonathan Robie; firstname.lastname@example.org
Subject: Re: [xml-dev] limits of the generic
3. Similarly, how to compare whether two durations are the same.
Also, I do think that someone who's gone to the trouble of creating a
W3C XML Schema schema for their markup language is going to expect
that the data types they specified within their schema for the
elements/attributes will be used in the document, so that they won't
have to do:
<xsl:sort select="@num" data-type="number" />
if they've already specified that the 'num' attribute is an integer
within the schema. This seems the most persuasive argument for
including support for W3C XML Schema data types in XPath 2.0.
Unfortunately, the current WDs don't actually manage to support the
latter requirement -- I'm thinking particularly of the restrictions on
xs:duration -- but there's still time to change, thus increasing the
net gain from having the data types.