[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Change Months from English to French [XSLT 1.0]
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'">fivrier</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'">dicembr</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>
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|