zepheira / amara

Amara 2.0. Amara XML toolkit is an open-source collection of Python tools for XML processing, not just tools that happen to be written in Python, but tools built from the ground up to use Python idioms and take advantage of the many advantages of Python over other programming languages.
http://wiki.xml3k.org/Amara2
Apache License 2.0
23 stars 9 forks source link

Fixes broken datetime xslt extension. (fixes #20) #21

Open mied opened 9 years ago

mied commented 9 years ago

This should fix the broken implementation. Now my test file (see issue #20) doesn't fail anymore and outputs this:

<out xmlns:date="http://exslt.org/dates-and-times">
  <datetime>2015-02-04T17:41:29Z</datetime>
  <date>2000-01-02Z</date>
  <time>03:04:05Z</time>
  <year>2000</year>
  <leapyear>true</leapyear>
  <monthinyear>1</monthinyear>
  <monthname>January</monthname>
  <monthabbreviation>Jan</monthabbreviation>
  <weekinyear>52</weekinyear>
  <dayinyear>2</dayinyear>
  <dayinmonth>2</dayinmonth>
  <dayofweekinmonth>1</dayofweekinmonth>
  <dayinweek>1</dayinweek>
  <dayname>Sunday</dayname>
  <dayabbreviation>Sun</dayabbreviation>
  <hourinday>3</hourinday>
  <minuteinhour>4</minuteinhour>
  <secondinminute>5</secondinminute>
  <formatdate>Sun, 2 Jan 2000 03:04:05</formatdate>
  <weekinmonth>1</weekinmonth>
  <difference>P1DT3H4M5S</difference>
  <add>2000-01-03T04:05:06Z</add>
  <addduration>P5DT6H7M8S</addduration>
  <sum>P22Y11MT11H</sum>
  <seconds>946782245</seconds>
  <duration>P1DT2H3M4S</duration>
</out>