/ Published in: XSLT

Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<xsl:template name="formatDate"> <xsl:param name="dateTime" /> <xsl:variable name="date" select="substring-before($dateTime, 'T')" /> <xsl:variable name="year" select="substring-before($date, '-')" /> <xsl:variable name="month" select="substring-before(substring-after($date, '-'), '-')" /> <xsl:variable name="day" select="substring-after(substring-after($date, '-'), '-')" /> <xsl:value-of select="concat($day, ' ', $month, ' ', $year)" /> </xsl:template> <xsl:template name="formatTime"> <xsl:param name="dateTime" /> <xsl:value-of select="substring-after($dateTime, 'T')" /> </xsl:template> <xsl:call-template name="formatDate"> <xsl:with-param name="dateTime" select="xpath" /> </xsl:call-template> <xsl:call-template name="formatTime"> <xsl:with-param name="dateTime" select="xpath" /> </xsl:call-template>
Comments
