Monday, September 22, 2014

XML-22036: (Error) Cannot convert result tree fragment to NodeSet - Oracle SOA Suite 11g

XML-22036: (Error) Cannot convert result tree fragment to NodeSet - Oracle SOA Suite 11g

We are getting the below exception in runtime while passing the parameter and accessing the same from XSLT in Oracle SOA Suite.

The following exception occurred while attempting to execute operation copy at line 139
-<exception class="com.collaxa.cube.xml.xpath.XPathException">
-<parsererror style="display: block; white-space: pre; border: 2px solid #c77; padding: 0 1em 0 1em; margin: 1em; background-color: #fdd; color: black">
<h3>This page contains the following errors:</h3>
<div style="font-family:monospace;font-size:12px">
error on line 7 at column 1: Extra content at the end of the document
<h3>Below is a rendering of the page up to the first error.</h3>
XPath expression failed to execute.
An error occurs while processing the XPath expression; the expression is ora:doXSLTransformForDoc('xsl/DistinctPayload.xsl', $inputVariableLocal.payload, 'FlowSubscriberVar2', $FlowSubscriberVar2).
The XPath expression failed to execute; the reason was: javax.xml.transform.TransformerException: oramds:/deployed-composites/default/PPDSOM_EventManager_rev1.0/xsl/DistinctPayload.xsl<Line 8, Column 82>: XML-22036: (Error) Cannot convert result tree fragment to NodeSet..
Check the detailed root cause described in the exception message text and verify that the XPath query is correct.

The actual issue is, the xsl:param name in the XSLT is different from the parameter name send from BPEL.

The issue got resolved after changing the xsl:param in XSLT as same as the parameter name in Oracle BPEL.

1 comment:

  1. Nice find! Also, if the parameter that is being passed is actually a specific part of a message-type variable, such as "body", then the parameter name in the XSLT must even include that. Like xsl:param name="FlowSubscriberPart2.body" and "$FlowSubscriberPart2.body/ns1:parameters/ns1:fSubscriber" for the example above.