I have a written a class mediator to call an endpoint, by using the response from the backend endpoint I am following a JSONArray, converting it into an XML string and setting context property. I am using a payload Factory mediator to format the xml payload and send it to XSLT. But I am getting the below error if I try XSLT transformations.
The evaluation of the XPath expression xslt-data did not result in an OMNode : null org.apache.synapse.SynapseException: The evaluation of the XPath expression xslt-data did not result in an OMNode : null
But if I use the respond Mediator, I get the proper XML data in response.
Here is my Payload coming from class mediator:
<array>
<discount>0.0000</discount>
<locale>en</locale>
<total_tax>10.8900</total_tax>
<customer_id>315</customer_id>
<currency_id>UN</currency_id>
</array>
<array>
<discount>1.23</discount>
<locale>un</locale>
<total_tax>10.45</total_tax>
<customer_id>316</customer_id>
<currency_id>USD</currency_id>
</array>
Here's my code payloadFactory formatting:
<payloadFactory media-type="xml">
<format>
<data xmlns="">
$1
</data>
</format>
<args>
<arg evaluator="xml" expression="get-property('RESPONSE')"/>
</args>
</payloadFactory>
<property name="messageType" scope="axis2" type="STRING" value="application/xml"/>
How can I resolve this error to perform the XSLT transformation? Thanks