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:

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.

_______________________________________________
exslt mailing list
[email protected]
http://www.exslt.org/list
patch (application/octet-stream, 547 B) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.