|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: sum of products
Steve,
> Is there another method that does not use node-set?
You could use this recursive template:
<xsl:template name="prod-sum">
<xsl:param name="sum">0</xsl:param>
<xsl:param name="nodes" />
<xsl:choose>
<xsl:when test="$nodes">
<xsl:call-template name="prod-sum">
<xsl:with-param name="sum"
select="$sum + number($nodes[1]/a) * number($nodes[1]/b)" />
<xsl:with-param name="nodes" select="$nodes[position()!=1]" />
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$sum" />
</xsl:otherwise>
</xsl:choose>
</xsl:template>
Regards,
Marco
***************************DISCLAIMER***********************************
Deze e-mail is uitsluitend bestemd voor de geadresseerde(n).
Verstrekking aan en gebruik door anderen is niet toegestaan.
Fortis sluit iedere aansprakelijkheid uit die voortvloeit uit
electronische verzending.
This e-mail is intended exclusively for the addressee(s), and may
not be passed on to, or made available for use by any person
other than the addressee(s).
Fortis rules out any and every liability resulting from any
electronic transmission.
************************************************************************
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








