Reputation: 25220
HI all, I got a JavaScript function to convert the date, but I was wondering if there is any way to convert the date with xsl without using JavaScript.
Thanks.
Upvotes: 1
Views: 6994
Reputation: 2391
Found a very good post on date formatting here.
No Javascript required. Only XSL elements and XPath String functions can do the job.
Upvotes: 0
Reputation: 531
You can use the Microsoft formatter.
Or the format-date
function, if you are using XSLT 2.0 (which .Net does not).
Upvotes: 1
Reputation: 25220
Thanks to all of you for answering my question, after looking on those links you left me to take a look I came out with something very simple.
<xsl:for-each select="//MaternityDiaryEvent/DateOfVisit">
<xsl:value-of select="concat(substring(.,9,2),'/',substring(.,6,2),'/',substring(.,3,2))"/>
</xsl:for-each>
Thanks again to all, I'll give you a vote to each of you.
Cesar.
Upvotes: 1
Reputation: 9044
and the string manipulation, http://www.xml.com/pub/a/2002/05/01/xslt-string.html
Upvotes: 1