【发布时间】:2012-10-03 11:57:48
【问题描述】:
我有客户发票,我使用以下函数计算此列(针对每张发票和每个客户)的价格*数量 + 总额: 全部的
<xsl:template name="sumProducts">
<xsl:param name="pList"/>
<xsl:param name="pRunningTotal" select="0"/>
<xsl:choose>
<xsl:when test="$pList">
<xsl:variable name="varMapPath" select="$pList[1]"/>
<xsl:call-template name="sumProducts">
<xsl:with-param name="pList" select="$pList[position() > 1]"/>
<xsl:with-param name="pRunningTotal" select="$pRunningTotal + $varMapPath/unitprice * $varMapPath/quantity"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
$<xsl:value-of select="format-number($pRunningTotal, '#,##0.00')"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
我想计算每个客户的所有发票的总和以及所有客户的总发票。
谢谢
【问题讨论】:
-
请编辑问题并提供源 XML 文档(最好是小的),目前缺少。