XSLT Formating Date and DateTime
718998Aug 24 2009 — edited Aug 25 2009Hi,
I am new to XSLT, so please hekp me with my questions
I have XML time stamp 2009-08-24T13:59:15.880-07:00 and I want to format it to 08/24/2009 1:59:15 PM. I write the following code to format it as below. I am using XSLT 1.0 (not 2.0)
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<field><name>TIMESTAMP</name><id>0</id>
<simple xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:type="xs:string">
<xsl:value-of select="xsl:format-dateTime(fc:ContractIdRequest/fc:TimeStamp, '[M01]/[D01]/[Y0001][H01]:[m01]:[s01][PN]')" /></simple>
</field>
but there was a problem at run time as
org.springframework.integration.transformer.AbstractPayloadTransformer.transform(AbstractPayloadTransformer.java:33)
... 49 more
Caused by: java.lang.NoSuchMethodException: For extension function, could not find method org.apache.xml.utils.NodeVector.formatDateTime([ExpressionContext,] #STRING).**
at org.apache.xalan.extensions.MethodResolver.getMethod(MethodResolver.java:274)
I am not sure xslt 1.0 suport format-dateTime function? I also looked in XPath function but no luck.
Thanks in advance for your help.
Eric
Edited by: user11821075 on Aug 24, 2009 3:26 PM
Edited by: user11821075 on Aug 24, 2009 4:08 PM