<?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>Using XSL to display Roses</title>
			</head>
			<body>
				<div align="center">
					<h1>Roses Displayed using XSL</h1>
					<img src="roses.jpg"/>
					<hr/>
				</div>
				<table align="center" width="100%" cellspacing="15">
					<xsl:for-each select="roses/rose">
						<tbody>
							<tr align="center">
								<td align="center" colspan="3">
									<xsl:apply-templates select="picture"/>
								</td>
								<tr>
									<td align="center" colspan="3">
										<b>Rose images and descriptions</b>
									</td>
								</tr>
							</tr>
							<tr style="background-color:e59da6; color:maroon;">
								<th>Botanical Name</th>
								<th>Variety Name</th>
								<th>Class Name</th>
							</tr>
							<tr>
								<th>
									<xsl:value-of select="name/botanical_name"/>
								</th>
								<th>
									<xsl:value-of select="name/var_name"/>
								</th>
								<th>
									<xsl:value-of select="name/class_name"/>
								</th>
							</tr>
							<tr style="background-color:e59da6; color:maroon;">
								<th>Color</th>
								<th>Size</th>
								<th>Form</th>
							</tr>
							<tr>
								<th>
									<xsl:value-of select="color"/>
								</th>
								<th>
									<xsl:value-of select="size"/>
								</th>
								<th>
									<xsl:value-of select="form"/>
								</th>
							</tr>
							<tr style="background-color:e59da6; color:maroon;">
								<td align="center" colspan="3">
									<xsl:apply-templates select="website"/>
								</td>
							</tr>
						</tbody>
					</xsl:for-each>
				</table>
			</body>
		</html>
	</xsl:template>
	<xsl:template match="picture">
		<img>
			<xsl:attribute name="src"><xsl:value-of select="./@filename"/></xsl:attribute>
			<xsl:attribute name="width"><xsl:value-of select="./@x"/></xsl:attribute>
			<xsl:attribute name="height"><xsl:value-of select="./@y"/></xsl:attribute>
		</img>
	</xsl:template>
	<xsl:template match="website">
		<a>
			<xsl:attribute name="href"><xsl:value-of select="./@href"/></xsl:attribute>
			<xsl:value-of select="."/>
		</a>
	</xsl:template>
</xsl:stylesheet>

