<?xml version="1.0"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xs">
	<xsl:import-schema namespace="http://www.w3.org/1999/xhtml" schema-location="http://www.w3.org/2002/08/xhtml/xhtml1-strict.xsd"/>
	<xsl:strip-space elements="*"/>
	<xsl:template match="/">
		<xsl:result-document method="xml" href="myxhtml.html" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" indent="yes">
			<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" xsl:validation="strict">
				<head>
					<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
					<style type="text/css">
						body{font-family:verdana, arial, sans-serif}
						tr.heading{background-color:silver; color:black}
						tr.alt{background-color:lightgreen; color:black} td.count{text-align:center}
						td.number{text-align:right}
						table, th, td{border: 1px solid silver; border-collapse:collapse}
					</style>
					<title>Catalog of Products</title>
				</head>
				<body>
					<h1>Catalog of Products</h1>
					<p>
						<a href="http://www.xmlplease.com/xsltcases">www.xmlplease.com/xsltcases</a>
					</p>
					<table cellpadding="5" cellspacing="0">
						<tr class="heading">
							<th>No</th>
							<th>Name</th>
							<th>Price</th>
							<th>Stock</th>
							<th>Country</th>
						</tr>
						<xsl:apply-templates/>
					</table>
				</body>
			</html>
		</xsl:result-document>
	</xsl:template>
	<xsl:template match="product">
		<tr xsl:validation="strict">
			<xsl:if test="position() mod 2 = 0">
				<xsl:attribute name="class">alt</xsl:attribute>
			</xsl:if>
			<td class="count">
				<xsl:value-of select="position()"/>
			</td>
			<td>
				<xsl:value-of select="name"/>
			</td>
			<td class="number">
				<xsl:value-of select="price"/>
			</td>
			<td class="number">
				<xsl:value-of select="stock"/>
			</td>
			<td>
				<xsl:value-of select="country"/>
			</td>			
		</tr>
	</xsl:template>
</xsl:stylesheet>
