【问题标题】:How to Concatenate multiple repetitive nodes into a single node - BizTalk如何将多个重复节点连接成一个节点 - BizTalk
【发布时间】:2019-11-17 14:04:39
【问题描述】:

我在输入 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>

以上数据连接后需要映射为以下架构

<Order>
    <Note>0012:Text1#ZT03:Text2</Note>
</Order>

有人可以帮忙吗?

【问题讨论】:

    标签: dictionary concatenation biztalk


    【解决方案1】:

    我将假设您的输入实际上有一个 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>
    

    那么你只需要一张这样的地图

    用字符串连接functoid

    Input[0] = text_type
    Input[1] = :
    Input[2] = text_content
    Input[3] = #
    

    进入累积连接

    这会给你一个输出

    <Order>
      <Note>0012:Text1#ZT03:Text2#</Note> 
    </Order>
    

    注意:末尾有一个额外的 #,但如果需要,您可以使用更多 functoid 将其删除。

    【讨论】:

      【解决方案2】:

      您可以在映射中使用Value-Mapping Flattening functoid,然后将每个结果输入 Concatenate functoid 以生成结果字符串。映射可以在端口或编排中执行。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2016-06-26
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多