输入 XML:
<Orders>
<Order>
<sample id="a">23435</sample>
.
.
.
<sample id="x">D123</sample>
.
.
<sample id="y">5346</sample>
<sample id="z"></sample>
.
.
</Order>
<Order>
<sample id="a">23435</sample>
.
.
.
<sample id="x">D345</sample>
.
.
<sample id="y">5346</sample>
<sample id="z">D217</sample>
.
.
</Order>
<Order>
<sample id="a">23435</sample>
.
.
.
<sample id="x">D1235</sample>
.
.
<sample id="y">5346</sample>
<sample id="z"></sample>
.
.
</Order>
要求:
如果属性='z'的'sample'元素没有值,那么我需要将属性'x'的'sample'元素映射到'ProId';否则,如果它有价值,那么我不应该将任何值传递给“ProFeed”地图。(对于每个“订单”元素,我需要创建一个“ProFeed”地图)
输出:
[ProFeed={ProId="",Lang="eng",CatId="AU"},ProFeed={ProId="",Lang="eng",CatId="AU"},ProFeed={ProId="",Lang="eng",CatId="AU"}]
数据编织配置:
%input application/xml
%output application/java
.(some configuration code)
.
.
请帮助我配置 DataWeave 组件。