<?xml version="1.0"?>

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">


<xsl:include href = "style.xsl" /> 
<xsl:template match="/">
  
	<html>
  
		<body>

		<xsl:call-template name="Style1"/>
			<h1> Product Listing </h1>
    			<table>
      
				<tr>

					<th>ID</th>
        
					<th>Name</th>

					<th>Price</th>
					<th>Quantity</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>

			<br /> 
			<xsl:text>
			Total Products: </xsl:text> 
               		<xsl:value-of select = "count(//product)" />  
		</body>
  
	</html>

</xsl:template>
</xsl:stylesheet>
