...Technology Simplified

Thursday, October 11, 2012

How to display current Date and Time calling Templates in XSLT using C#

No comments :
The below script converts 'dd-mm-yyyy' to 'yyyymmdd' format.
<xsl:template name="formatDate">
<xsl:param name="dateTime" />
<xsl:variable name="dd" select="substring($dateTime,1,2)" />
<xsl:variable name="mm" select="substring($dateTime,4,2)" />
<xsl:variable name="yyyy" select="substring($dateTime,7,4)" />
<xsl:value-of select="concat($yyyy,$mm,$dd)" />
</xsl:template>


<xsl:call-template name="formatDate">
<xsl:with-param name="dateTime" select="TestDate" />
</xsl:call-template>

No comments :

Post a Comment