|
Subject: Re: [xsl] Working with xs:date and xs:gYearMonth From: Colin Paul Adams <colin@xxxxxxxxxxxxxxxxxx> Date: 23 Jun 2004 15:18:12 +0100 |
>>>>> "Michael" == Michael Kay <mhk@xxxxxxxxx> writes:
Michael> <xsl:variable name="first-of-previous-month"
Michael> select="xs:date('0000-01-01') + ($previous-month *
Michael> $one-month)" as="xs:date"/>
>> Well, Saxon 8.0 doesn't allow this (quite right too - there
>> never was a year zero!).
Michael> Actually, this is a minor disaster in XML Schema: in the
As opposed to the major disaster that is XML Schema itself?
Michael> proleptic Gregorian calendar as defined by ISO 8601:2000
Michael> the year before 0001 is indeed 0000, but in XML Schema it
Michael> is -0001.
Michael> The fact that there was never a year zero is rather
Michael> irrelevant; there was never a year -1 either. The
Michael> numbers we use were assigned to these years posthumously!
which ghost did the assigning then?
Post-factum, perhaps.
Michael> Saxon's date arithmetic on BC dates is probably
Michael> unreliable because of these problems, it's not something
Michael> that is very well tested. It would be safer to use a
Michael> later date as a baseline.
I'll bear it in mind.
>> I tried substituting -0001-01-01, which saxon doesn't complain
>> of, but date='{first-of-previous-month}'" is coming out as
>> date=''.
Michael> Missing "$" perhaps?
Yes.
I've got it all working now, but using 1st December 2 BCE (well -0002-12-01) as a
baseline (weird - but that's what works, for now anyway.).
--
Colin Paul Adams
Preston Lancashire
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| RE: [xsl] Working with xs:date and , Michael Kay | Thread | Re: [xsl] Working with xs:date and , Colin Paul Adams |
| RE: [xsl] How to quote "${abc}" so , Passin, Tom | Date | Re: [xsl] Get NaN when adding, Markus Abt |
| Month |