我正在尝试计算 for 循环中的记录数及其值的总和(对于特定列)。请找到以下代码并建议我。
<xsl:for-each-group select="current-group()" group-by="CostCentre/PCCode">
<!-- variables for each pc code -->
<xsl:variable name="chargeRate" select="SpaceTariffGroup/ChargeRate"/>
<xsl:variable name="dedicatedArea"
select="sum((current-group()[SpaceType/ChargeBackType = $chargeBackTypeDedicatedArea]/(Area*CalculationFactor)))"/>
<xsl:variable name="floorFactor"
select="$dedicatedArea div ($totalDedicatedAreaPerFloor )"/>`enter code here`
<xsl:variable name="floorCommonArea"
select="$floorFactor * $totalFloorCommonAreaPerFloor"/>
<xsl:variable name="dedicatedAndFloorCommonArea"
select="($dedicatedArea + $floorCommonArea)"/>
<xsl:variable name="totalChargedArea"
select="$dedicatedAndFloorCommonArea"/>
<xsl:variable name="totalChargedAmount"
select="$chargeRate * $totalChargedArea"/>
<xsl:value-of select="$totalChargedArea"/>
<xsl:text>,</xsl:text>
<xsl:value-of select="$totalChargedAmount"/>
enter code here
</xsl:for-each-group>
会打印这样的东西。100,5000 200,5000 300,5000 400,5000
我想要这样的输出。100,5000 200,5000 300,5000 400,5000 4,20000 (最后一行是总记录,这些记录的值的总和)不知道我怎样才能得到它