Subject: Re: [xsl] Hash / Translation Tables (the right way) From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx> Date: Sun, 25 Sep 2011 17:32:40 -0400 |
I'm having some problems with constructs like hash tables or indexes, which are quick in other languages but presently I am using some brute force with. E.G.
<xsl:template name="month-of"> <xsl:param name="mon"/> <xsl:choose> <xsl:when test="lower-case($mon) = 'jan'"> <xsl:value-of select="'01'"/> </xsl:when> <xsl:when test="lower-case($mon) = 'feb'"> <xsl:value-of select="'02'"/> </xsl:when> <xsl:when test="lower-case($mon) = 'mar'"> <xsl:value-of select="'03'"/> </xsl:when>
It seems there must be a way to accomplish this with a simple sequence. Months of the year, days of the week, and other one to one translations from the textual to ordinal or vice versa.
-- Contact us for world-wide XML consulting and instructor-led training Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Google+ profile: https://plus.google.com/116832879756988317389/about Legal business disclaimers: http://www.CraneSoftwrights.com/legal
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Hash / Translation Tables (th, Hank Ratzesberger | Thread | Re: [xsl] Hash / Translation Tables, Michael Kay |
[xsl] Hash / Translation Tables (th, Hank Ratzesberger | Date | Re: [xsl] Hash / Translation Tables, Michael Kay |
Month |