<?xml version='1.0' encoding='utf-8' ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">


<xsl:template match="/">



<html>
<head>

<title>
Stylesheet Example
</title>
<STYLE>
H1 {COLOR: red; FONT-FAMILY: Arial; FONT-SIZE: 14pt;}
H2 {COLOR: darkblue; FONT-FAMILY: Arial; FONT-SIZE: 12pt;}
.subhead {COLOR: darkblue; FONT-FAMILY: Arial; FONT-SIZE: 12pt;}
.text {COLOR: black; FONT-FAMILY: Arial; FONT-SIZE: 12pt;}
TH {COLOR: white; FONT-FAMILY: Arial; background-color:
darkblue;}
TD {COLOR: blue; FONT-FAMILY: Arial}
TR { background-color: beige; }
BODY { background-color: beige; }
</STYLE>

</head>

<body>

<H1>Product Listing</H1>
<table border="1">
<TR><TH>ID</TH><TH>Name</TH><TH>Price</TH><TH>Quality</TH></TR>
<xsl:for-each select="catalog/product">
<xsl:sort select="prodid"/>
<TR>
<TD>
<xsl:value-of select="prodid" /> 
</TD>
<TD>
<xsl:value-of select="name" /> 
</TD>
<TD>
<xsl:value-of select="price" />
</TD>
<TD>
<xsl:value-of select="quantity" />
</TD>
</TR>
</xsl:for-each>
</table>

<div class="text">
Total Products: 
<xsl:value-of select="count(catalog/product)" />
<br />
Total Products of Quantity: 
<xsl:value-of select="sum(catalog/product/quantity)" /></div>


</body>
</html>

</xsl:template>
</xsl:stylesheet>
