Sunday, November 18, 2012

Failed to evaluate xpath expression ora:formatDate


Using the Oracle XPath extension function ora:formatDate in your transformation in JDeveloper as shown:
ora:formatDate(/ns1:payload/ns0:OrderDate, 'mm-dd-yyyy')
Resulted in the following runtime error:
path function failed because:oracle.xml.parser.v2.XMLElement java.lang.ClassCastException: oracle.xml.parser.v2.XMLElement
        at oracle.fabric.common.xml.xpath.FabricXPathFunctionWrapper.evaluate(
        at oracle.xml.xpath.JXPathContext$JXFunction.invoke(
        at oracle.xml.xpath.JXPathContext$JXFunction.invoke(
        at oracle.xml.xpath.XPathExtFunction.evaluate(
<Nov 7, 2012 2:51:07 PM EST> <Warning> <> <BEA-000000> <<WFTask.setFlexfieldMappingValue> Failed to evaluate xpath expression ora:formatDate(/ns1:payload/ns0:OrderDate,'mm-dd-yyyy') while performing payload mapping for OrderDate. Error was: XPath expression failed to execute.
An error occurs while processing the XPath expression; the expression is ora:formatDate(/ns1:payload/ns0:OrderDate,'mm-dd-yyyy').
The XPath expression failed to execute; the reason was: internal xpath error.
Check the detailed root cause described in the exception message text and verify that the XPath query is correct.


1. The element being passed as input did not conform to the date format expected by the ora:formatDate function.

The input date format to this function should be:  yyyy-mm-ddTHH:mm:ssZ


No comments: