|
[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]
pankaj.c@xxxxxxxxxxxxxxxxxx wrote:
Any direction in this regard will be highly appreciated. (NOTE: Input will be <date-printed>August 2010</date-printed> i.e., Month name [space] Year. Output required is Aout 2010) As long as that format is ensured it should be easy simply create a secondary XML document which maps the English names to the French names e.g. <map> <!-- put complete mapping here --> <month en="August" fr="Aout"/> </map> then load that file with the document function e.g. <xsl:variable name="month-map" select="document('map.xml')"/> then define a key e.g. <xsl:key name="mk" match="month" use="@en"/> then process e.g. <xsl:template match="date-printed">
<xsl:copy>
<xsl:variable name="em" select="substring-before(., ' ')"/>
<xsl:for-each select="$month-map">
<xsl:value-of select="key('mk', $em)/@fr"/>
</xsl:for-each>
<xsl:value-of select="concat(' ', substring-after(., ' '))"/>
</xsl:copy>
</xsl:emplate>-- Martin Honnen http://msmvps.com/blogs/martin_honnen/
|
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
|

Cart


![Re: Change Months from English to French [XSLT 1.0]](/images/get_stylus.gif)





