再帰関数を使用して、各請求書と各クライアントについて、計算列の合計 (価格 * 数量) を計算しました。次に、クライアントごとのすべての請求書と、すべてのクライアントのすべての請求書の合計を計算する必要があります。
xml は次のようになります。
  <cinvoices>
        <client> (with information @ client) </client>
            <invoices>
                <products>
                    <product> (information @ product: name, type ect and..
                        <price>123</price>
                        <quantity>21</quantity>
                    </product>
                    <product> (information @ product: name, type ect and..
                        <price>123</price>
                       <quantity>11</quantity>
                   </product>
                </products>
           <invoices>
               <products>
                    <product> (information @ product: name, type ect and..
                    <price>32</price>
                    <quantity>3</quantity>
               </product>
               <product> (information @ product: name, type ect and..
                    <price>12</price>
                    <quantity>9</quantity>
               </product>
           </products>
       </invoices>
    </client>
    <client>
      <same as above>
    </client>
    </cinvoices>
xslt で使用される関数は次のとおりです。
<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/price *    $varMapPath/quantity"/>                    
                </xsl:call-template> 
            </xsl:when> 
            <xsl:otherwise> 
                $<xsl:value-of select="format-number($pRunningTotal, '#,##0.00')"/> 
            </xsl:otherwise>  
        </xsl:choose> 
              </xsl:template>
===================== 関数は次のように呼び出されます:
  <xsl:call-template name="sumProducts"> 
                             <xsl:with-param name="pList" select="*/*"/> 
                             </xsl:call-template> 
この関数を使用して、各クライアントの請求書の合計と、すべてのクライアントとすべての請求書の総計を計算する方法について考えてください。
ありがとうございました。