I’m working on a site In that site some pages gets data from XML through XSLT. But the date is displayed as YYYY-MM-DD which ideally is taken from the XML which was in this format. I would like to convert this format to DD-MM-YYYY through XSLT or some other possible way.
Please suggest me an idea to go ahead or provide me the code to achieve this ASAP. This is the format of xml giving
<published date="2009-09-28T07:06:00 CET" />
and i want to convert this into
<published date="28-09-2009T07:06:00 CET" />
and this is xsl file
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<table class="bdr-bot" width="100%" border="0" cellspacing="0" cellpadding="0" style="clear:both">
<tr>
<th width="15%" class="bdr">Date</th>
<th class="bdr">Title</th>
</tr>
<xsl:for-each select="hexML/body/press_releases/press_release">
<xsl:if test="contains(published/@date, '2009')">
<tr>
<td valign="top">
<xsl:value-of select="substring-before(published/@date, 'T')"/>
</td>
<td valign="top">
<a href="result-page.aspx?ResultPageURL={location/@href}"><xsl:value-of select="headline"/></a>
</td>
</tr>
</xsl:if>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
Now tell me the solution? is this possible with fn:reverse?