原文件
customer1,order1,10
customer1,order2,30
目标文件
customer1,40
原文件2行记录,新文件1行记录,并对数量作累加(10+30=40)。
mapping的时候要用哪个FUNCTIONID,或者怎么设置。
多谢
------解决方案--------------------------------------------------------
把你FF变成的xml文档
<xml>
<x customer= "customer1 " order= "order1 " n= "10 "/>
<x customer= "customer1 " order= "order2 " n= "30 "/>
</xml>
xslt文件:
<xsl:for-each-group select= "xml/x " group-by= "@customer ">
<tr>
<td> <xsl:value-of select= "@customer "/> </td>
<td>
<xsl:value-of select= "current-group()/@order " separator= ", "/>
</td>
<td> <xsl:value-of select= "sum(current-group()/@n) "/> </td>
</tr>
</xsl:for-each-group>
结果:
<table>
<tr>
<th> customer1 </th>
<th> order1,order2 </th>
<th> 40 </th>
</tr>
</table>