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