[英]How to Concatenate multiple repetitive nodes into a single node - BizTalk
我在輸入 XML 中有類似的東西
<OrderText>
<text_type>0012</text_type>
<text_content>Text1</text_content>
</OrderText>
<OrderText>
<text_type>ZT03</text_type>
<text_content>Text2</text_content>
</OrderText>
將上述數據連接為以下架構后,我需要 map
<Order>
<Note>0012:Text1#ZT03:Text2</Note>
</Order>
有人可以幫忙嗎?
您可以在 map 中使用Value-Mapping Flattening functoid,然后將每個結果輸入 Concatenate functoid 以生成結果字符串。 map 可以在端口或編排中執行。
我將假設您的輸入實際上有一個 Root 節點,否則它不是有效的 XML。
<Root>
<OrderText>
<text_type>0012</text_type>
<text_content>Text1</text_content>
</OrderText>
<OrderText>
<text_type>ZT03</text_type>
<text_content>Text2</text_content>
</OrderText>
</Root>
那么你只需要一個像這樣的 map
使用字符串連接 functoid
Input[0] = text_type
Input[1] = :
Input[2] = text_content
Input[3] = #
進入累積連接
這會給你一個 output
<Order>
<Note>0012:Text1#ZT03:Text2#</Note>
</Order>
注意:末尾有一個額外的 #,但如果需要,您可以使用更多 functoid 將其刪除。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.