<?xml version="1.0" encoding="ISO-8859-1" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:output method = "xml"
	            indent="no"
				xmlns="http://www.w3.org/1999/XML"
				omit-xml-declaration = "no"
	            encoding="ISO-8859-1"
				/>
<!--
	            doctype-public= "-//W3C//DTD XML 1.1//EN"
-->
	<xsl:template match = "/product-list">
		<xsl:param name = "pid"><xsl:value-of select = "@pid" /></xsl:param>
		<xsl:param name = "eid"><xsl:value-of select = "@eid" /></xsl:param>
		<html-fragment>
			<p>
				[ <a><xsl:attribute name = "href">javascript:switch_config('demonstration_6:welcome_brochure')</xsl:attribute>Shopping Home</a> | <a><xsl:attribute name = "href">javascript:product_view('<xsl:value-of select = "$eid" />')</xsl:attribute>View Product List</a> ]
			</p>
			<xsl:apply-templates select = "product[@pid = $pid]">
				<xsl:with-param name = "eid" select = "$eid" />
				<xsl:with-param name = "pid" select = "$pid" />
			</xsl:apply-templates>
		</html-fragment>
	</xsl:template>
	<xsl:template match = "product">
		<xsl:param name = "eid" />
		<xsl:param name = "pid" />
<!--		<p><xsl:value-of select = "@name" /> (<xsl:value-of select = "$eid" />, <xsl:value-of select = "$pid" />)</p>-->
		<xsl:choose>
			<xsl:when test = "count(item) > 0">
				<ul>
				<xsl:apply-templates select = "item">
					<xsl:with-param name = "eid" select = "$eid" />
					<xsl:with-param name = "pid" select = "$pid" />
				</xsl:apply-templates>
				</ul>
			</xsl:when>
			<xsl:otherwise>
				<p><b>Zero Items</b></p>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	<xsl:template match = "item">
		<xsl:param name = "eid" />
		<xsl:param name = "pid" />
		<li><a><xsl:attribute name = "href">javascript:product_view('<xsl:value-of select = "$eid" />',<xsl:value-of select = "$pid" />,<xsl:value-of select = "@iid" />);</xsl:attribute><xsl:value-of select = "@name" /></a></li>
	</xsl:template>
</xsl:stylesheet>


