I am working on Multi-language site which need the date to be displayed in japanese language set. I have US date like 12-29-2010 which need to be displayed in japanese as 2010年12月29日. I am using开发者_运维百科 XSLT 3432 to do. Can you please let me know how I can do that.
I have to convert english date to japanese from the db, which has many different month/day/year and is updated regularly. This is just an example I have provided.
I am using XSLT and can use Javascript in it
This transformation:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output omit-xml-declaration="yes" indent="yes"/>
<xsl:param name="pUSDate" select="'12-29-2010 '"/>
<xsl:template match="/">
<xsl:value-of select=
"concat(substring($pUSDate,7,4),
'年',
substring($pUSDate,1,2),
'月',
substring($pUSDate,4,2),
'日'
)
"/>
</xsl:template>
</xsl:stylesheet>
when applied on any XML document (not used), produces the wanted, correct result:
2010年12月29日
精彩评论