今天有人问到,如何将一个XML中,多个节点下的字段进行累加后,变成另一个XML的一个字段。
就象SQL中的SUM()函数一样,将一个Column的值进行求和。



[BTS]Cumulative Functloids用法如:

输入XML:
<ns0:Root xmlns:ns0="http://xslttest.sourcexml/">
  <Records>
    <A>
      <V1>1</V1>
      <V2>2</V2>
    </A>
    <A>
      <V1>2</V1>
      <V2>3</V2>
    </A>
    <A>
      <V1>3</V1>
      <V2>4</V2>
    </A>
  </Records>
  <Records>
    <A>
      <V1>7</V1>
      <V2>8</V2>
    </A>
    <A>
      <V1>8</V1>
      <V2>9</V2>
    </A>
    <A>
      <V1>9</V1>
      <V2>2</V2>
    </A>
  </Records>
</ns0:Root>


输出XML:
<ns0:Root xmlns:ns0="http://xslttest.destxml/">
 <Records>
  <V1_SUM>1,2,3</V1_SUM>
  <V2_SUM>9</V2_SUM>
  </Records>
  <Records>
   <V1_SUM>7,8,9</V1_SUM>
   <V2_SUM>19</V2_SUM>
  </Records>
</ns0:Root>

实例上可以直接用BizTalk Mapping中的Cumulative Sum Functloids,非常简单。

示例下载

[BTS]Cumulative Functloids用法

相关文章:

  • 2022-02-25
  • 2021-11-18
  • 2021-06-26
  • 2021-09-17
  • 2021-08-08
  • 2021-06-29
  • 2021-06-20
  • 2022-02-03
猜你喜欢
  • 2021-10-29
  • 2021-09-27
  • 2021-09-28
  • 2022-02-15
  • 2021-07-30
  • 2022-02-20
  • 2021-09-17
相关资源
相似解决方案