using xt-extensions for getting a string of date

Subject: using xt-extensions for getting a string of date
From: felix@xxxxxxxxxxxxxxxxxxxxxx
Date: Tue, 7 Mar 2000 16:51:55 +0100
Hi,

I am trying to use the extent the date.xsl example from the xt-distro.
I want it to print the string for a given date, not the actual date
like that demo does. I tried something like this

<xsl:stylesheet
  version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
  xmlns:date="http://www.jclark.com/xt/java/java.util.Date";>

<xsl:template match="/">
  <html>
    <xsl:if test="function-available('date:to-string') and
function-available('date:new')">
      <xsl:variable name="year">2000</xsl:variable>
      <xsl:variable name="month">1</xsl:variable>
      <xsl:variable name="day">2</xsl:variable>
      <p><xsl:value-of select="date:to-string(date:new(2000,1,2))"/></p>
      <p><xsl:value-of select="date:to-string(date:new($year,$month,$day))"/></p>
    </xsl:if>
  </html>
</xsl:template>

</xsl:stylesheet>    


It should give out the strings for the 02.01.2000. But xt just tells
me:
new:illegal arguments

So I think it is trying to give the arguments as strings instead of
integers as the constructor of Date is expecting. How can I get this
to work? I am especially interested in the second case, where I call
date:new with variables.

Thanks in advance.
 Felix Schumacher

ps: I hope this is not to far off-topic.


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread