From: Markus A. <al...@de...> - 2006-07-07 16:29:39
|
Hi all, here's a problem that an user has reported lately when he was working on a program using xslt. It seems to the a bug in the libxslt RPM of the AIX Toolbox for Linux, as it works with the libxslt installations on various Linux systems where I've tested this (different distributions and different levels). To demonstrate the wrong behavior, the user has provided me with two small files (attached below), which when invoked as "xsltproc sample.xsl input.xml" should return the current date and time like this: altmark@pdw7: xslt (10) $ xsltproc sample.xsl input.xml DateTime: 2006-07-07T18:10:46+02:00, Date: 07/07/06, Time: 06:10:46 This works fine as long as the timezone (TZ) variable has a negative offset to UTC, like here in Germany where we have TZ=CET-1CEST, thus explicitly running altmark@pdw7: xslt (11) $ env TZ="CET-1CEST" xsltproc sample.xsl input.xml DateTime: 2006-07-07T18:11:00+02:00, Date: 07/07/06, Time: 06:11:00 is ok, too. But for e.g. Eastern Time in the US one gets: altmark@pdw7: xslt (12) $ env TZ="EST5EDT" xsltproc sample.xsl input.xml DateTime: , Date: , Time: As said, the latter works on a Linux machine (RHEL4 in the following case): altmark@hdcl028: xslt (9) $ env TZ="EST5EDT" xsltproc sample.xsl input.xml DateTime: 2006-07-07T11:51:53-04:00, Date: 07/07/06, Time: 11:51:53 To reproduce the problem: 1. Create a directory "xslt" and save the two attached files in that directory. 2. Create a subdirectory "exslt" and another two subdiretories "date" and "str" underneath it. 3. From www.exslt.org, download date.zip [1] and str.zip [2] and extract them to the "date" and "str" directories respectively. 4. Go to the top level "xslt" directory and run the command listed above: "xsltproc sample.xsl input.xml" with different settings for the TZ environment variable. The strange thing is that it even works on a Linux machine with an older version of libxslt (1.0.33-5) installed than on AIX. Can anybody more familiar with xslt than me please shed some light on this? Thanks! Regards, Markus [1] http://www.exslt.org/date/date.zip [2] http://www.exslt.org/str/str.zip -- Markus Alt IBM Lab Boeblingen, Germany al...@de... |