<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl" >
	<xsl:output method="html"/>
	<xsl:template match="/">
		<html>
			<head>
				<title>Restaurants</title>
			</head>
			<body>
				<h1>Recommended Restaurant</h1>
				<p> In Chicago, I recommend <xsl:value-of select="Restaurants/Restaurant/@Name" />
				</p>
				<h1>Restaurants by location</h1>
					<table border="1">
						<tr>
							<th>Restaurant Name</th>
							<th>City</th>
							<th>State</th>
							<th>Quality</th>
							<th>Price</th>
						</tr>
						<xsl:for-each select="Restaurants/Restaurant" >
						<xsl:sort select="Location/State" />
							<tr>
								<td>
									<xsl:value-of select="@Name" />
								</td>
								<td>
									<xsl:value-of select="Location/City" />
								</td>
								<td>
									<xsl:value-of select="Location/State" />
								</td>
								<td>
									<xsl:value-of select="@QualityRating" />
								</td>
								<td>
									<xsl:value-of select="@PriceRating" />
								</td>
							</tr>
						</xsl:for-each>
					</table>
					<!--Restaurants that serve vegetarian-->
					<h1>Restaurants with Vegetarian Choices</h1>
					<xsl:for-each select="Restaurants/Restaurant">
						<xsl:if test="Menu/MenuItem/@IsVegetarian='true'">
							<h3>
								<xsl:value-of select="@Name" />
								<table border="1">
									<tr>
										<th>Menu Item</th>
										<th>Price</th>
										<th>Calories</th>
									</tr>
										<xsl:if test="Menu/MenuItem/@IsVegetarian='true'">
									<tr>
										<td>
											<xsl:value-of select="Menu/MenuItem" />
										</td>
										<td>
											<xsl:value-of select="Menu/MenuItem/@Price" />
										</td>
										<td>
											<xsl:value-of select="Menu/MenuItem/@Calories" />
										</td>
									</tr>
										</xsl:if>
									</table>
							</h3>
						</xsl:if>
					</xsl:for-each>
				</body>
		</html>
	</xsl:template>
</xsl:stylesheet>