Re: [xsl] Return system's date and time

Subject: Re: [xsl] Return system's date and time
From: Abel Braaksma <abel.online@xxxxxxxxx>
Date: Mon, 14 May 2007 11:54:46 +0200
J. S. Rawat wrote:

<xsl:value-of select="current-time()" />
Error: Unknown system function: corrent-time

Using
xmlns:fn="http://www.w3.org/2005/02/xpath-functions"; and <xsl:value-of select="fn:current-time()" />
Error: The URI http://www.w3.org/2005/02/xpath-functions does not identify an external Java class
Processor: Saxon
stylsheet version:1.0



You seem to be using Saxon. Why do you use XSLT 1.0? You can easily switch to XSLT 2.0 by changing the version attribute. Saxon (8.9) supports XSLT 2.0 completely.


If you need to stick to XSLT 1.0, you are out of luck with basic XSLT, as the 1.0 does not have any date functions. But you can use the exslt extension functions, I believe that Saxon supports them. But then again: it is way easier to just change your version attribute of the xsl:stylesheet instruction.

Cheers,
-- Abel Braaksma

Current Thread