<?xml version="1.0" encoding="utf-8"?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:web="http://www.webwinkel.nl" exclude-result-prefixes="web">
	<xsl:output method="html" version="4.01" encoding="UTF-8" indent="yes"/>
	<xsl:template match="/">

		<html>
			<header>
				<title>Bestelling</title>
			</header>
			<body>
				<h3>Bestelling van <xsl:value-of select="//web:klantnaam"/></h3>
				<table>
					<tr>
						<th>omschrijving</th>
						<th>productID</th>
						<th>aantal</th>
					</tr>
					<xsl:for-each select="/web:bestelling/web:product">
						<xsl:variable name="kleur">
							<xsl:choose>
								<xsl:when test="position() mod 2=0">#00dddd</xsl:when>
								<xsl:otherwise>#00aaaa</xsl:otherwise>
							</xsl:choose>
						</xsl:variable>	
						
						<tr bgcolor="{$kleur}">
							<td>
								<xsl:value-of select="./web:omschrijving"/>
							</td>
							<td>
								<xsl:value-of select="./web:productid"/>
							</td>
							<td>
								<xsl:value-of select="./web:aantal"/>
							</td>
						</tr>
					</xsl:for-each>
				</table>
				<br></br>
				datum: <xsl:value-of select="concat(//web:jaar,'-',//web:maand,'-',//web:dag)"/>
			</body>
		</html>

	</xsl:template>
</xsl:stylesheet>
