[xslt] Bug report: Related to EXSLT date:add( )
- From: money_seshu Dronamraju <mcseshu gmail com>
- To: xslt gnome org
- Cc: mcseshu gmail com
- Subject: [xslt] Bug report: Related to EXSLT date:add( )
- Date: Fri, 19 Nov 2010 10:20:42 +0530
Hi,
Problem description: EXSLT date:add() adds days to xs:gYearMonth/xs:gYear incorrectly when month is January
The following 2 expressions returns incorrect date:
<xsl:value-of select="date:add( "2001-01", "P3D" )" /> -> returns 2001-01
<xsl:value-of select="date:add( "2001", "P12D" )')" /> -> returns 2001
Ideally it should return "2001-01-04" and "2001-01-13" respectively.
Root cause:
In _exsltDateAdd(..,..) function ( libxslt/trunk/libexslt/date.c)
Because the month is January(1), "if" condition will never evaluate to true, even though the day was changed , so it never returns return type as XS_DATE
Patch: attached.
Please provide your comments.
After the patch:
----------------------
<xsl:value-of select="date:add( "2001-01", "P3D" )" /> -> returns 2001-01-04
<xsl:value-of select="date:add( "2001", "P12D" )')" /> -> returns 2001-01-13
Thanks,
Satya
Attachment:
date.diff
Description: Binary data
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]