Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Add Values in a For-Each

Status
Not open for further replies.

ietprofessional

Programmer
Joined
Apr 1, 2004
Messages
267
Location
US
I have a for-each that has a value-of statement, which has a price value. Can someone tell me how to add the values of the prices? I need to be able to print the total price for the services.

Thanks,
Harold

<xsl:for-each select="NewDataSet/Table">
<table cellpadding="1" width ="575">
<tr>
<td width = "80%">
<xsl:value-of select="ServiceName"/>
</td>
<td width = "10%">
<xsl:value-of select="TimesPerDay"/>
</td>
<td align = "right" width = "10%">
<xsl:value-of select="ServicePrice"/>
</td>
</tr>
</table>
</xsl:for-each>
 
Outside the <xsl:for-each>, something like <xsl:value-of select="sum(NewDataSet/Table/ServicePrice)">
Have a look at thread426-837483
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top