Hello,
I'm writing an xsl file in order to write out xml. I have a couple of date fields that I need to format in a specific pattern. Can I do this by creating a named template which defines the pattern? I must format it in the xsl rather than changing .net code.
this is what I'm trying but my node comes back empty.
The template definition (I pulled the value from an XSD file):
Calling the template
Any help is greatly appreciated. Thanks in advance!
I'm writing an xsl file in order to write out xml. I have a couple of date fields that I need to format in a specific pattern. Can I do this by creating a named template which defines the pattern? I must format it in the xsl rather than changing .net code.
this is what I'm trying but my node comes back empty.
The template definition (I pulled the value from an XSD file):
Code:
<xsl:template name="DateTimePattern">
<xsl:param name="thisDate">
<pattern xmlns="[URL unfurl="true"]http://www.w3.org/2001/XMLSchema"[/URL] value="\d{4}-\d\d-\d\d \d\d:\d\d:\d\d[.]\d\d\d"/>
</xsl:param>
</xsl:template>
Code:
<xsl:if test="PolicyExpDate!= ''">
<policy_exp_date>
<xsl:call-template name="DateTimePattern">
<xsl:with-param name="thisDate" select="PolicyExpDate"></xsl:with-param>
</xsl:call-template>
</policy_exp_date>
</xsl:if>
Any help is greatly appreciated. Thanks in advance!