Hello,
I am trying to implement a simple example from Michael Kay's XSLT 2.0 3rd edition book in a xslt I have. It's the comment example from page 240, where the comment should output file generation properties.
I call a template similar to the following from the book:
Code:
<xsl:template name="file-properties">
<xsl:comment>
<xsl:text> Generated on: </xsl:text>
<xsl:value-of select="format-dateTime(
current-dateTime(), '[D] [MNn] [Y] at [H]:[m01]:[s01]')" />
<xsl:text> using </xsl:text>
<xsl:value-of select="system-property('xsl:product-name')" />
<xsl:text> version </xsl:text>
<xsl:value-of select="system-property('xsl:product-version')" />
</xsl:comment>
</xsl:template>
At first I get errors stating the date functions are not valid XSLT or XPATH functions. I have the following namespaces declared at the top:
Code:
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:fn="http://www.w3.org/2004/07/xpath-functions"
xmlns:xdt="http://www.w3.org/2004/07/xpath-datatypes">
Next I try to prepend the functions with either xs: or fn: (I've tried both) and get a complaint that "Namespace
whichever does not contain any functions.
Any suggestions on how to implement this? I don't know if its an error from the book example, or something I am doing wrong.
Thanks in advance for your help,
Dan