I want check if a Node is present in an XML payload or not. For this purpose I want to use xpath3() in Transform Message in mule4.
Input:
<XML xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ABC xsi:nil="true"/>
<DEF/>
</XML>
dataweave code:
%dw2.0
output application/json skipNullOn="everywhere"
---
if(xpath3('//:ABC',payload.XML,'BOOLEAN')
"abc": "yes
else
"abc": "no"
Expected Output( json):
{
"abc": "yes"
}
Please Help me with this.
