Skip to Main Content

Integration

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

String To Date Conversion inside XSLT

697692Nov 30 2009 — edited Nov 30 2009
Hi All,

I want to convert a string of (Eg:06/12/2009 00:00:00) to a date type of format yyyy-mm-dd Vice versa.

I am successful in converting Date to String

<element name="input" type="date"/> (Schema)

<element name="result" type="string"/> (Schema)


<ns1:SIDtoCRMProcessResponse>
<ns1:result>
<xsl:value-of select='xp20:format-dateTime(/ns1:SIDtoCRMProcessRequest/ns1:input,"[M01]/[D01]/[Y0001] [H01]:[m01]:[s01]")'/>
</ns1:result>
</ns1:SIDtoCRMProcessResponse>


but when try to do String to Date

<element name="input" type="string"/> (Schema)

<element name="result" type="date"/> (Schema)

<ns1:CRMToSIDProcessResponse>
<ns1:result>
<xsl:value-of select='xp20:format-dateTime(/ns1:CRMToSIDProcessRequest/ns1:input,"[Y0001]-[M01]-[D01]")'/>
</ns1:result>
</ns1:CRMToSIDProcessResponse>

its failing

I think format-dateTime function expects input as date. Can anyone kindly help me how to convert String to Date inside an xsl without using external java function.
Thank You
This post has been answered by Eric Elzinga on Nov 30 2009
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 28 2009
Added on Nov 30 2009
5 comments
6,490 views