我正在使用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