Never thought of that and now I am getting input XML like:
Input:
<date-printed>June/July 2010</date-printed>
Output:
<date-printed>juin/juillet 2010</date-printed>
The below code of course fails in this case, I have something in my mind
but that seems to be dirty solution (Defining all combination of month
something like <xsl:when test="$month-en = 'June/July'">juin/juillet
</xsl:when> ). :-)
Any directions in this regard will be appreciated.
<xsl:template match="date-printed">
<xsl:variable name="month-en" select="substring-before(.,' ')"/>
<xsl:variable name="year" select="substring-after(.,' ')"/>
<xsl:variable name="month-fr">
<xsl:choose>
<xsl:when test="$month-en = 'January'">janvier</xsl:when>
<xsl:when test="$month-en = 'February'">février</xsl:when>
<xsl:when test="$month-en = 'March'">mars</xsl:when>
<xsl:when test="$month-en = 'April'">avril</xsl:when>
<xsl:when test="$month-en = 'May'">peut</xsl:when>
<xsl:when test="$month-en = 'June'">juin</xsl:when>
<xsl:when test="$month-en = 'July'">juillet</xsl:when>
<xsl:when test="$month-en = 'August'">août</xsl:when>
<xsl:when test="$month-en = 'September'">septembre</xsl:when>
<xsl:when test="$month-en = 'October'">octobre</xsl:when>
<xsl:when test="$month-en = 'November'">novembre</xsl:when>
<xsl:when test="$month-en = 'December'">décembr</xsl:when>
</xsl:choose>
</xsl:variable>
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:attribute name="xml:lang">fr</xsl:attribute>
<xsl:value-of select="$month-fr"/>
<xsl:text> </xsl:text>
<xsl:value-of select="$year"/>
</xsl:copy>
</xsl:template>
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--