ank5
asked on
XSL - change date format
I have an xml element such as
then in xsl-fo, I am fetching thsi value to display in a PDF document
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
<time_stamp>11/03/2016 09:04:21</time_stamp>
then in xsl-fo, I am fetching thsi value to display in a PDF document
<xsl:value-of select="time_stamp"/>
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
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
to make it work
you will need
<xsl:apply-templates select="time_stamp"/>
instead of
<xsl:value-of select="time_stamp"/>
you will need
<xsl:apply-templates select="time_stamp"/>
instead of
<xsl:value-of select="time_stamp"/>
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