输入文件是-
<A>
<B>
<merchant_ref>icici</merchant_ref>
<transaction_tag>sdfhisdb</transaction_tag>
<transaction_type>inquiry</transaction_type>
<method>valuelink</method>
<order_number>123</order_number>
<amount>1000</amount>
<currency_code>CAD</currency_code>
</B>
<B>
<merchant_ref>icici</merchant_ref>
<transaction_tag>sdfhisdb</transaction_tag>
<transaction_type>inquiry</transaction_type>
<method>valuelink</method>
<order_number>123</order_number>
<amount>2000</amount>
<currency_code></currency_code>
</B>
<B/>
<B>
<merchant_ref>icici</merchant_ref>
<transaction_tag>sdfhisdb</transaction_tag>
<transaction_type>inquiry</transaction_type>
<method>valuelink</method>
<order_number>123</order_number>
<amount>4000</amount>
<currency_code></currency_code>
</B>
<B>
<merchant_ref>icici</merchant_ref>
<transaction_tag>sdfhisdb</transaction_tag>
<transaction_type>inquiry</transaction_type>
<method>valuelink</method>
<order_number>123</order_number>
<amount>5000</amount>
<currency_code></currency_code>
</B>
</A>
尝试在 dataweave 中使用以下代码进行映射
%output application/xml
---
Inquiry: payload.A.*B mapObject
{
balanceInquiry:
{
request: {
amount:{
amount: payload.A.B.amount/1000 as :number,
currency: payload.A.B.currency_code
}
}
}
}
我正在尝试映射 A 下的 B 的每个值,但每次我得到相同的第一件事 5 倍于金额 1.0 是否应该更改为 2.0 4.0 和 5.0
请纠正我如果我做错了什么来实现 B 的所有值