xsl-list
[Top] [All Lists]

another error in date:difference template ...

2004-07-08 02:25:12

All,

Please be aware of another apparent error in the date:difference template:
the duration calculated across leap-days is one day short, so:

      <xsl:call-template name = "date:difference">
            <xsl:with-param name = "start"      select = "'2004-02-28'" />
            <xsl:with-param name = "end"  select = "'2004-03-10'" />
      </xsl:call-template>

yields duration = "P1D" instead of P2D as expected (2004 is a leap year).

I attach a test harness which can be used to illustrate the problem. I have
reproduced the behaviour using msxsl and xalantransform.
Does anyone else agree?

HMcA

(See attached file: date-diff-test.xsl)


This message and any attachments (the "message") is 
intended solely for the addressees and is confidential. 
If you receive this message in error, please delete it and 
immediately notify the sender. Any use not in accord with
its purpose, any dissemination or disclosure, either whole 
or partial, is prohibited except formal approval. The internet 
can not guarantee the integrity of this message. 
BNP PARIBAS (and its subsidiaries) shall (will) not 
therefore be liable for the message if modified. 

**********************************************************************************************

BNP Paribas Private Bank London Branch is authorised 
by CECEI & AMF and is regulated by the Financial Services
Authority for the conduct of its investment business in the
United Kingdom.

BNP Paribas Securities Services London Branch is authorised
by CECEI & AMF and is regulated by the Financial Services
Authority for the conduct of its investment business in the 
United Kingdom.
  
BNP Paribas Fund Services UK Limited is authorised and 
regulated by the Financial Services Authority.

Attachment: date-diff-test.xsl
Description: Binary data

_______________________________________________
exslt mailing list
list(_at_)exslt(_dot_)org
http://www.exslt.org/list
<Prev in Thread] Current Thread [Next in Thread>