我正在使用Enrich Mediator
来丰富XML。Enrich调解器仅适用于WSO2 ESB中的第一个元素5
我的问题是,它总是适用于第一个元素,但我想将其应用于多个元素。我如何将它应用于XPATH选择的所有元素?
我也试过下面的选项。但失败。
//Response/ResponseDetails/SearchHotelPriceResponse/HotelDetails/Hotel[@HasExtraInfo="true"]
富民配置:
<enrich>
<source type="inline">
<ImageCode xmlns="">IMG10004</ImageCode>
</source>
<target action="child" xpath="//Response/ResponseDetails/SearchHotelPriceResponse/HotelDetails/Hotel[*]"/>
</enrich>
XML有效载荷:
<Response ResponseReference="REF_D_028_749-2801486459143247">
<ResponseDetails Language="en">
<SearchHotelPriceResponse>
<HotelDetails>
<Hotel HasExtraInfo="true" HasMap="true" HasPictures="true">
<City Code="LON">London</City>
<Item Code="ALE1">ALEXANDRA</Item>
<StarRating>3</StarRating>
<HotelRooms>
<HotelRoom Code="SB" NumberOfRooms="1"/>
</HotelRooms>
</Hotel>
<Hotel HasExtraInfo="true" HasPictures="true">
<City Code="LON">London</City>
<Item Code="ALO">Aloft London Excel</Item>
<StarRating>4</StarRating>
<HotelRooms>
<HotelRoom Code="SB" NumberOfRooms="1"/>
</HotelRooms>
</Hotel>
<Hotel HasExtraInfo="true" HasMap="true" HasPictures="true">
<City Code="LON">London</City>
<Item Code="AMB3">Ambassadors Bloomsbury</Item>
<StarRating>4</StarRating>
<HotelRooms>
<HotelRoom Code="SB" NumberOfRooms="1"/>
</HotelRooms>
</Hotel>
</HotelDetails>
</SearchHotelPriceResponse>
</ResponseDetails>
</Response>
- ESB 5.0.0
没错! Thanx Ernesto。 – namalfernandolk