I have transformation in dataweave.
I am getting input from the Mysql database. Input payload type is List- Map. My dataweave editer has below code.
%dw 1.0
%namespace ns1 urn:abc:api:Components
%output application/xml
---
ns1#"ItemRequest":{
ns1#"Requester":
ns1#ac: payload.time_max,
ns1#"ErrorLanguage": "en_US",
ns1#"WarningLevel": "High"
}
My output is
<?xml version='1.0' encoding='UTF-8'?>
<ns1:ItemRequest xmlns:ns1="urn:abc:api:Components">
<ns1:Requester>
<ns1:ac>
<time_max>1</time_max>
</ns1:ac>
</ns1:Requester>
<ns1:ErrorLanguage>en_US</ns1:ErrorLanguage>
<ns1:WarningLevel>High</ns1:WarningLevel>
</ns1:AddItemRequest>
I am not sure why i am getting tag created under'ac' element in my output with 'time_max'. The 'Time_max' is the column name in MySQL table. But i dont want to add the column in the output xml. How can we avoid this tag creation ?
Expected output is
<?xml version='1.0' encoding='UTF-8'?>
<ns1:ItemRequest xmlns:ns1="urn:abc:api:Components">
<ns1:Requester>
<ns1:ac>1</ns1:ac>
</ns1:Requester>
<ns1:ErrorLanguage>en_US</ns1:ErrorLanguage>
<ns1:WarningLevel>High</ns1:WarningLevel>
</ns1:AddItemRequest>