I have an XML document with the following node:
<date>09/01/2012</date>
How can i format the date with XSLT to retrieve another representation of the date?
Here ist the expected resul开发者_C百科t:
<date>2012-01-09</date>
I tried the following rule, but it returns an empty string (i suppose because of the uncommon date input format):
<date><xsl:value-of select="format-date(date, '[Y0001]-[M01]-[D01]')"/></date>
Thanks to Abdullah Battal, i came up with the following solution:
<xsl:value-of select="concat(substring(date, 7, 4), '-', substring(date, 4, 2), '-', substring(date, 1, 2))"/>
精彩评论