I am trying to migrate my Mule 3.4 CE applications to Mule 3.6.1 CE and having issues with xpath3.
Payload:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:itemMessage xmlns:ns2="http://test.com/messages">
<requestId>QAREQ:150623_0002</requestId>
<requestStatus>COMPLETE</requestStatus>
</ns2:itemMessage>
xpath expression (working)
#[xpath('string(//itemMessage/requestId/text())')]
xpath3 expression (not working)
#[xpath3('//itemMessage/requestId/text()', payload, 'STRING')]
Appreciate any insight.
Your Xpath expression does not seem to match the XML document. But based on the XML document this works:
<mulexml:namespace-manager
includeConfigNamespaces="true">
<mulexml:namespace prefix="ns2" uri="http://test.com/messages" />
</mulexml:namespace-manager>
<flow name="testFlow">
<poll doc:name="Poll">
<set-payload
value="<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <ns2:itemMessage xmlns:ns2="http://test.com/messages"> <requestId>QAREQ:150623_0002</requestId> <requestStatus>COMPLETE</requestStatus> </ns2:itemMessage>"
doc:name="Set Payload" />
</poll>
<logger level="INFO" message="#[xpath3('ns2:itemMessage/requestId/text()', payload, 'STRING')]" />
</flow>