[xml/sgml-pkgs] Bug#271757: libxslt1.1: date:difference() timezone bugginess

Sal Paradise "Sal Paradise" <m2kyj0402@sneakemail.com>, 271757@bugs.debian.org
15 Sep 2004 01:08:19 -0000


Subject: libxslt1.1: date:difference() timezone bugginess

Package: libxslt1.1

Version: 1.1.8-4

Severity: normal



The EXSLT function date:difference() produces bad values on some

inputs described here.  Basically, the timezone correction is applied with the

wrong sign (four hours are subtracted during GMT normalization when they really

should have been added).



Apply the following stylesheet to any XML document (the XML input is ignored)

using xsltproc to reproduce.



<?xml version="1.0" encoding="utf-8"?>

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"

  xmlns:date="http://exslt.org/dates-and-times" version="1.0">



  <xsl:output method="text"/>



<xsl:variable name="nl">

<xsl:text>

</xsl:text>

</xsl:variable>



  <xsl:template match="/">

    <xsl:variable name="start" select="'2003-02-19T10:56:10-04:00'"/>

    <xsl:variable name="end"   select="'2003-02-19T15:56:10Z'"/>

    <xsl:value-of select="date:difference($start, $end)"/>

    <xsl:value-of select="$nl"/>

  </xsl:template>



</xsl:stylesheet>





The buggy output from libxslt1.1 is:

PT9H



The correct output should be:

PT1H



-- System Information:

Debian Release: 3.1

  APT prefers unstable

  APT policy: (500, 'unstable')

Architecture: i386 (i686)

Kernel: Linux 2.6.7

Locale: LANG=C, LC_CTYPE=C



Versions of packages libxslt1.1 depends on:

ii  libc6                       2.3.2.ds1-16 GNU C Library: Shared libraries an

ii  libgcrypt11                 1.2.0-6      LGPL Crypto library - runtime libr

ii  libgpg-error0               1.0-1        library for common error values an

ii  libxml2                     2.6.11-3     GNOME XML library

ii  zlib1g                      1:1.2.1.1-7  compression library - runtime



-- no debconf information