/ Published in: XML
Building blocks for outputting a month's name in XSLT, using an old "assembler trick".
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<!-- 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" />