Search the Community
Showing results for tags 'current date'.
-
Hi everybody, I try to implement and to show the current date in my stylesheet, but I obtain this error message during the compilation : ERROR: 'Impossible to compile the stylesheet' FATAL ERROR: 'Error during the verification of type of expression 'funcall(current-date, [])'.' :Error during the verification of type of expression 'funcall(current-date, [])'. This is an extract of my stylesheet : <?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"> <xsl:output method="html" indent="yes" /> ... <xsl:template name="getMonth"> <xsl:param name="monthNbr" /> <xsl:choose> <xsl:when test="$monthNbr=1"> Janvier </xsl:when> <xsl:when test="$monthNbr=2"> Février </xsl:when> <xsl:when test="$monthNbr=3"> Mars </xsl:when> <xsl:when test="$monthNbr=4"> Avril </xsl:when> <xsl:when test="$monthNbr=5"> Mai </xsl:when> <xsl:when test="$monthNbr=6"> Juin </xsl:when> <xsl:when test="$monthNbr=7"> Juillet </xsl:when> <xsl:when test="$monthNbr=8"> Août </xsl:when> <xsl:when test="$monthNbr=9"> Septembre </xsl:when> <xsl:when test="$monthNbr=10"> Octobre </xsl:when> <xsl:when test="$monthNbr=11"> Novembre </xsl:when> <xsl:when test="$monthNbr=12"> Décembre </xsl:when> </xsl:choose> </xsl:template> <xsl:template name="date_jour"> <xsl:variable name="currentDate" select="current-date()" /> <xsl:variable name="year" select="year-from-date($currentDate)" /> <xsl:variable name="month"> <xsl:call-template name="getMonth"> <xsl:with-param name="monthNbr" select="month-from-date($currentDate)" /> </xsl:call-template> </xsl:variable> <xsl:variable name="day" select="day-from-date($currentDate)" /> <xsl:value-of select="format-number($day,'00')" /> <xsl:text> </xsl:text> <xsl:value-of select="$month" /> <xsl:text> </xsl:text> <xsl:value-of select="$year" /> </xsl:template>... </xsl:stylesheet> Any ideas ? Thank you in advance Fabrice