[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Sum question.

Subject: Sum question.
From: champion boliao <gsem980@xxxxxxxxxxxx>
Date: Thu, 27 Mar 2003 16:26:06 +0800 (CST)
andrew agassi
This is my data.xml:
<?xml version="1.0" encoding="ISO-8859-1" ?> 
<catalog>
<cd>
  <title>Empire Burlesque</title> 
  <artist>Bob Dylan</artist> 
  <country>USA</country> 
  <company>Columbia</company> 
  <price>10.90</price> 
  <year>1985</year> 
  </cd>
<cd>
  <title>Empire Sun MicroSystems</title> 
  <artist>Andrew Agassi</artist> 
  <country>USA</country> 
  <company>Apple</company> 
  <price>10.92</price> 
  <year>1999</year> 
</cd>
<cd>
  <title>Empire Microsoft Windows</title> 
  <artist>Bill Gate</artist> 
  <country>USA</country> 
  <company>Seattle</company> 
  <price>130.90</price> 
  <year>1987</year> 
</cd>
</catalog>

This is my data.xsl:
<?xml version="1.0" encoding="ISO-8859-1" ?> 
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
  <h2>My CD Collection</h2> 
<table border="1">
<tr bgcolor="#9acd32">
  <th align="left">Title</th> 
  <th align="left">Artist</th> 
</tr>
<xsl:for-each select="catalog/cd">
<tr>
<td>
  <xsl:value-of select="title" /> 
</td>
<td>
<xsl:value-of select="artist" /> 
  </td>
  </tr>
  </xsl:for-each>
  </table>
  </body>
  </html>
  </xsl:template>
</xsl:stylesheet>

This is my question:
How should I modify my data.xsl to output the sum of
CD price in my last line. That is to say, after loop
through all the CD information, in my last line, I
want to display the Sum of all price.

Please give me your insight.
Thank you.

__________________________________________________
Do You Yahoo!?
Promote your business from just $5 a month!
http://sg.biztools.yahoo.com

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.