RE: RE: another error in date:difference template ...
"Jordan, Tom" <[email protected]>
| Newsgroups | gmane.text.xml.xslt.extensions,gmane.text.xml.xsl.general.mulberrytech |
|---|---|
| Message-ID | <[email protected]> |
Harry:
Ok, that isn't going to work.
I expanded your test harness to the one attached.
I just changed this result matrix:
<?xml version="1.0" encoding="UTF-8"?>
pass: 2004-02-26 + P2D = 2004-02-28 [2004-02-28]
fail: 2004-02-28 + P1D = 2004-02-29 [2004-03-01]
pass: 2003-02-26 + P2D = 2003-02-28 [2003-02-28]
pass: 2003-02-28 + P1D = 2003-03-01 [2003-03-01]
pass: 2002-12-30 + P2D = 2003-01-01 [2003-01-01]
pass: 2002-12-30 + P61D = 2003-03-01 [2003-03-01]
pass: 2000-12-30 + P2D = 2001-01-01 [2001-01-01]
fail: 2000-02-28 + P307D = 2000-12-31 [2001-01-01]
fail: 2003-12-30 + P3D = 2004-01-02 [2004-01-01]
pass: 2003-12-30 + P62D = 2004-03-01 [2004-03-01]
fail: 2000-12-30 + P1098D = 2004-01-02 [2004-01-01]
pass: 2000-12-30 + P1157D = 2004-03-01 [2004-03-01]
fail: 2000-02-28 + P1462D = 2004-02-29 [2004-03-01]
for this one:
<?xml version="1.0" encoding="UTF-8"?>
fail: 2004-02-26 + P3D = 2004-02-29 [2004-02-28]
pass: 2004-02-28 + P2D = 2004-03-01 [2004-03-01]
pass: 2003-02-26 + P2D = 2003-02-28 [2003-02-28]
pass: 2003-02-28 + P1D = 2003-03-01 [2003-03-01]
pass: 2002-12-30 + P2D = 2003-01-01 [2003-01-01]
pass: 2002-12-30 + P61D = 2003-03-01 [2003-03-01]
pass: 2000-12-30 + P2D = 2001-01-01 [2001-01-01]
fail: 2000-02-28 + P307D = 2000-12-31 [2001-01-01]
fail: 2003-12-30 + P3D = 2004-01-02 [2004-01-01]
pass: 2003-12-30 + P62D = 2004-03-01 [2004-03-01]
fail: 2000-12-30 + P1098D = 2004-01-02 [2004-01-01]
pass: 2000-12-30 + P1157D = 2004-03-01 [2004-03-01]
fail: 2000-02-28 + P1462D = 2004-02-29 [2004-03-01]
-- Tom.
> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]] On Behalf Of Jordan, Tom
> Sent: Thursday, July 08, 2004 12:02 PM
> To: [email protected]; [email protected]
> Cc: [email protected]; [email protected]
> Subject: [exslt] RE: another error in date:difference template ...
>
> Harry:
>
> Try this patch:
>
> --8<-- snip --8<--
> 146c146,155
> < <xsl:variable name="end-y-1"
> select="$end-year - 1" />
> ---
> >
> <xsl:variable name="end-y-1">
> >
> <xsl:choose>
> >
> <xsl:when test="$start-year = $end-year">
> >
> <xsl:value-of select="$end-year" />
> >
> </xsl:when>
> >
> <xsl:otherwise>
> >
> <xsl:value-of select="$end-year - 1" />
> >
> </xsl:otherwise>
> >
> </xsl:choose>
> >
> </xsl:variable>
> 263c272
> < </xsl:stylesheet>
> \ No newline at end of file
> ---
> > </xsl:stylesheet>
> --8<-- snip --8<--
>
> Cheers,
> -- Tom.
>
> > -----Original Message-----
> > From: [email protected]
> > [mailto:[email protected]]
> > Sent: Thursday, July 08, 2004 4:25 AM
> > To: [email protected]
> > Cc: Jordan, Tom; [email protected];
> > [email protected]
> > Subject: another error in date:difference template ...
> >
> >
> > 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.
> >
> >
> >
> > ---
> > Incoming mail is certified Virus Free.
> > Checked by AVG anti-virus system (http://www.grisoft.com).
> > Version: 6.0.716 / Virus Database: 472 - Release Date: 7/5/2004
> >
> >
> >
>
> ---
>
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.716 / Virus Database: 472 - Release Date: 7/5/2004
>
>
>
> This e-mail or the documents accompanying this e-mail contain
> information that may be confidential and/or privileged. It may
> also be prohibited from disclosure under applicable law. The
> information is intended to be for the use of the individual or
> entity named on this transmission. If you are not the intended
> recipient, be aware that any disclosure, copying, distribution
> or use of the contents of this information is without
> authorization and is prohibited. If you have received this
> e-mail in error, please notify us immediately so that we can
> take action to correct the problem.
>
>
> ---
> Incoming mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.716 / Virus Database: 472 - Release Date: 7/5/2004
>
>
>
---
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.716 / Virus Database: 472 - Release Date: 7/5/2004
_______________________________________________
exslt mailing list
[email protected]
http://www.exslt.org/list
date-diff-test.xsl
(application/octet-stream, 5.7 KB) - not displayed