<fo:block start-indent="5mm">
<xsl:for-each select="//policyResult[not(AgentNumber=preceding-sibling::policyResult/AgentNumber)]" >
<xsl:variable name="agentNum"><xsl:value-of select="AgentNumber"></xsl:value-of>
</xsl:variable>
<xsl:for-each select="//policyResult[AgentNumber=$agentNum]">
<xsl:sort select="agentnumber"/>
<xsl:sort select="policynumber"/>
<fo:table border-style="" width="100%" border-spacing="4">
<fo:table-body>
<fo:table-row border-before-style="solid">
<fo:table-cell>
<fo:block>
<fo:inline>Pol Number</fo:inline><xsl:value-of select="PolicyNumber"/>
</fo:block>
</fo:table-cell>
</fo:table-body>
</fo:table>
我寫了這樣的代碼來過濾重複的節點。 這裏我的問題是我要解決這升序秩序。XML看起來像這樣基於排序的節點排序,分組和總和?
<policyResult xmlns="" xmlns:ns2="http://ws.faithlife.com/resonant">
<producttype>risk</producttype> <PolicyNumber>003050669</PolicyNumber>
<AgentNumber>005262</AgentNumber>
<AnnualPremium>12000.0</AnnualPremium>
</policyResult>
<policyResult xmlns="" xmlns:ns2="http://ws.faithlife.com/resonant">
<producttype>wealth</producttype>
<PolicyNumber>003050669</PolicyNumber>
<AgentNumber>005282</AgentNumber>
<AnnualPremium>12000.0</AnnualPremium>
</policyResult>
<policyResult xmlns="" xmlns:ns2="http://ws.faithlife.com/resonant">
<producttype>risk</producttype>
<PolicyNumber>003050670</PolicyNumber>
<AgentNumber>005262</AgentNumber>
<AnnualPremium>12000.0</AnnualPremium>
</policyResult>
<policyResult xmlns="" xmlns:ns2="http://ws.faithlife.com/resonant">
<producttype>wealth</producttype>
<PolicyNumber>003050671</PolicyNumber>
<AgentNumber>005263</AgentNumber>
<AnnualPremium>12000.0</AnnualPremium>
</policyResult>
<policyResult xmlns="" xmlns:ns2="http://ws.faithlife.com/resonant">
<producttype>wealth</producttype>
<PolicyNumber>003050668</PolicyNumber>
<AgentNumber>005265</AgentNumber>
<AnnualPremium>12000.0</AnnualPremium>
</policyResult>
<policyResult xmlns="" xmlns:ns2="http://ws.faithlife.com/resonant">
<producttype>wealth</producttype>
<PolicyNumber>003050668</PolicyNumber>
<AgentNumber>005265</AgentNumber>
<AnnualPremium>12000.0</AnnualPremium>
</policyResult>
什麼,我要做的是過濾AgentNumber,AnnualPremium升序order.and需要總結每個代理的Annualpremium和所有Annualpremium的總和。
輸出應該是這樣的。 如果代理 重複數,我們必須以升序只有一次顯示它
產品類型:風險
代理人數量005266
policynumber 003050669 anuual保費12000
policynumber 003050671 anuual溢價12000
總年度溢價 - 該代理人的保費總額,即240 00
代理人數量005267
policynumber 00 anuual保費11000
policynumber 00 anuual保費11000這個代理的保費 總年保費--sum即22000
產品類型:財富
代理商編號005266
policynumber 003050669 anuual保費12000
policynumber 003050671 anuual溢價這個代理的保費12000
總年保費--sum即24000
代理人數量005267
policynumber 00 anuual溢價11000
政策編號00 anuual保費11000 總年保費本劑溢價--sum即22000
末我們需要顯示所有代理的總年度保費
總保費24000 --- 22000 + 46000 =
請幫我out..thanks提前
需要這種輸出的..