Return to Snippet

Revision: 75
at June 29, 2006 16:11 by greystate


Initial Code
<!-- Variable -->
<xsl:variable name="monthnames">January   February  March     April     May       June      July      August    September October   November  December  </xsl:variable>

<!-- Template -->
<xsl:template match="@date" mode="month-name">
	<xsl:variable name="index" select="number(substring(., 6, 2)) - 1" />
	<xsl:value-of select="normalize-space(substring($monthnames, $index * 10, 10))" />
</xsl:template>

<!-- Executioner -->
<xsl:apply-templates select="@date" mode="month-name" />

Initial URL

                                

Initial Description
Building blocks for outputting a month's name in XSLT, using an old "assembler trick".

Initial Title
Monthnames in XSLT

Initial Tags

                                

Initial Language
XML