EXSLT date normalization fix
authorJames Muscat <jrem@corefiling.com>
Tue, 4 Sep 2012 12:18:04 +0000 (20:18 +0800)
committerDaniel Veillard <veillard@redhat.com>
Tue, 4 Sep 2012 12:18:04 +0000 (20:18 +0800)
commit4ad8f1215e624188416d0f913cad972b9807614e
tree3d08444f0a164602dbbf26b9e56a409df1e7791a
parentaebfee35d1106035dddf897e0e81d72d110b5e63
EXSLT date normalization fix

https://bugzilla.gnome.org/show_bug.cgi?id=626855

Dates with timezones but no time components are not normalized correctly
Using xsltproc v1.1.26:

$ xsltproc --version
Using libxml 20706, libxslt 10126 and libexslt 815
xsltproc was compiled against libxml 20704, libxslt 10126 and libexslt
815
libxslt 10126 was compiled against libxml 20704
libexslt 815 was compiled against libxml 20704

Dates that have timezone offsets specified but no time components, for
example
"1970-01-01+01:00", are not normalized correctly; the timezone part is
truncated:

date:seconds("1970-01-01") = 0
date:seconds("1970-01-01+01:00") = 0 (not -3600 as expected)

Alters the conditions under which exsltDateNormalize() returns
without normalizing, and adds test cases demonstrating the new behaviour.
libexslt/date.c
tests/exslt/date/seconds.1.out
tests/exslt/date/seconds.1.xml