Link to home
Start Free TrialLog in
Avatar of ank5
ank5Flag for India

asked on

XSL - change date format

I have an xml element such as

<time_stamp>11/03/2016 09:04:21</time_stamp>

Open in new window


then in xsl-fo, I am fetching thsi value to display in a PDF document

<xsl:value-of select="time_stamp"/>

Open in new window


Is it possible to change the date format while displaying it. I would like to completely get rid of the time part and display the date as dd-Mmm-yyyy (eg., 11-Mar-2016)

Thank you
Avatar of Gertone (Geert Bormans)
Gertone (Geert Bormans)
Flag of Belgium image

Regardless the context of XSL-FO, this is a very common XSLT matter.
There is a whole bunch of functionality available if you were using XSLT2
For XSLT1 you are bound to either EXSLT (www.exslt.org) if your processor allows this
or some rudimentary string processing.
So it would help if you told us what the XSLT processor is for this
ASKER CERTIFIED SOLUTION
Avatar of Gertone (Geert Bormans)
Gertone (Geert Bormans)
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
to make it work
you will need
<xsl:apply-templates select="time_stamp"/>
instead of
<xsl:value-of select="time_stamp"/>