diff options
author | money_seshu Dronamraju <mcseshu@gmail.com> | 2011-03-07 12:12:11 +0800 |
---|---|---|
committer | Daniel Veillard <veillard@redhat.com> | 2011-03-07 12:12:11 +0800 |
commit | 4e9909066731067d8e256ca25d8d54944105bc5e (patch) | |
tree | 465bd24ef2c1f846c471cdae46613f8dd019ca5d /tests/general | |
parent | 7f741527832f4d85472c61f0468c1358f84810d7 (diff) | |
download | libxslt-4e9909066731067d8e256ca25d8d54944105bc5e.tar.gz libxslt-4e9909066731067d8e256ca25d8d54944105bc5e.tar.bz2 libxslt-4e9909066731067d8e256ca25d8d54944105bc5e.zip |
Fix a problem with ESXLT date:add() with January
Also adds a regression test provided by Michael Ludwig <milu71@gmx.de>
Diffstat (limited to 'tests/general')
-rw-r--r-- | tests/general/Makefile.am | 2 | ||||
-rw-r--r-- | tests/general/date_add.out | 9 | ||||
-rw-r--r-- | tests/general/date_add.xsl | 16 |
3 files changed, 26 insertions, 1 deletions
diff --git a/tests/general/Makefile.am b/tests/general/Makefile.am index 7207e15f..8f32fe7f 100644 --- a/tests/general/Makefile.am +++ b/tests/general/Makefile.am @@ -182,7 +182,7 @@ EXTRA_DIST = \ character.out character.xsl \ character2.out character2.xsl \ itemschoose.out itemschoose.xsl \ - inner.xsl + inner.xsl date_add.xsl all: diff --git a/tests/general/date_add.out b/tests/general/date_add.out new file mode 100644 index 00000000..fbca16b4 --- /dev/null +++ b/tests/general/date_add.out @@ -0,0 +1,9 @@ +<?xml version="1.0"?> +<dates-and-times> + <d>2001-01-04</d> + <d>2001-02-04</d> + <d>2001-12-04</d> + <d>2001-12-31</d> + <d>2002-01</d> + <d>2002-01-02</d> +</dates-and-times> diff --git a/tests/general/date_add.xsl b/tests/general/date_add.xsl new file mode 100644 index 00000000..0ef39c5a --- /dev/null +++ b/tests/general/date_add.xsl @@ -0,0 +1,16 @@ +<xsl:stylesheet version="1.0" + xmlns:date="http://exslt.org/dates-and-times" + exclude-result-prefixes="date" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> + <xsl:output indent="yes"/> + <xsl:template match="/"> + <dates-and-times> + <d><xsl:value-of select="date:add( '2001-01', 'P3D' )" /></d> + <d><xsl:value-of select="date:add( '2001-02', 'P3D' )" /></d> + <d><xsl:value-of select="date:add( '2001-12', 'P3D' )" /></d> + <d><xsl:value-of select="date:add( '2001-12', 'P30D' )" /></d> + <d><xsl:value-of select="date:add( '2001-12', 'P31D' )" /></d> + <d><xsl:value-of select="date:add( '2001-12', 'P32D' )" /></d> + </dates-and-times> + </xsl:template> +</xsl:stylesheet> |