Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

using formatdate in xsl stylesheet

Hi,

the following snippet of code is taken from an xsl stylesheet. The problem
I am having is when I try to apply the template defined to the varvalue field.
The code goes to the template and I can write out the value of varavlue but
as soon as I try to apply formatDate, an error occurs. This code is used
in other stylesheets, and in fact in this same stylesheet with no problem.

If anyone can help, it would be greatly approciated.

<xsl:when match=".[vartype ='7']">
<xsl:element name="INPUT">
<xsl:attribute name="value">
<xsl:apply-templates select="varvalue"/>
</xsl:attribute>
<xsl:attribute name="id"><xsl:value-of select="varid"/></xsl:attribute>
<xsl:attribute name="name"><xsl:value-of select="varid"/></xsl:attribute>
</xsl:element>
</xsl:when>

<xsl:template match="varvalue">
<xsl:eval>formatDate(2000-04-19T04:30:57, "yyyy-MM-dd ")</xsl:eval>
</xsl:template>

thanks,

Grainne
[1110 byte] By [Grainne] at [2007-11-9 14:54:51]
# 1 Re: using formatdate in xsl stylesheet
Did you have aby success with this. I am having the same sort of problem.

"Grainne" <Grainne.mcanee@singularity.co.uk> wrote:
>
>Hi,
>
>the following snippet of code is taken from an xsl stylesheet. The problem
>I am having is when I try to apply the template defined to the varvalue
field.
>The code goes to the template and I can write out the value of varavlue
but
>as soon as I try to apply formatDate, an error occurs. This code is used
>in other stylesheets, and in fact in this same stylesheet with no problem.
>
>
>If anyone can help, it would be greatly approciated.
>
>
><xsl:when match=".[vartype ='7']">
> <xsl:element name="INPUT">
> <xsl:attribute name="value">
> <xsl:apply-templates select="varvalue"/>
> </xsl:attribute>
> <xsl:attribute name="id"><xsl:value-of select="varid"/></xsl:attribute>
> <xsl:attribute name="name"><xsl:value-of select="varid"/></xsl:attribute>
> </xsl:element>
></xsl:when>
>
>
><xsl:template match="varvalue">
> <xsl:eval>formatDate(2000-04-19T04:30:57, "yyyy-MM-dd ")</xsl:eval>
></xsl:template>
>
>thanks,
>
>Grainne
>
Steven at 2007-11-11 23:34:00 >