<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:doc="http://nwalsh.com/xsl/documentation/1.0"
                exclude-result-prefixes="doc"
                version='1.0'>

<xsl:output method="html"
            encoding="ISO-8859-1"
            indent="no"/>

<!-- ******************************************************************** -->
    
<!-- ==================================================================== -->

<xsl:param name="foo" select="'html'"/>

<!-- ==================================================================== -->

<xsl:key name="id" match="*" use="@id"/>

<!-- ==================================================================== -->

<xsl:template match="*">
  <xsl:message>
    <xsl:text>No template matches </xsl:text>
    <xsl:value-of select="name(.)"/>
    <xsl:text>.</xsl:text>
  </xsl:message>

  <font color="red">
    <xsl:text>&lt;</xsl:text>
    <xsl:value-of select="name(.)"/>
    <xsl:text>&gt;</xsl:text>
    <xsl:apply-templates/>
    <xsl:text>&lt;/</xsl:text>
    <xsl:value-of select="name(.)"/>
    <xsl:text>&gt;</xsl:text>
  </font>
</xsl:template>

<xsl:template match="text()">
  <xsl:value-of select="."/>
</xsl:template>

<xsl:template match="tableofcontent">
		<div align="left"><h2>Table of Content</h2></div>

	  <xsl:value-of select="."/>
</xsl:template>

<xsl:template match="articles">
		<div align="left"><h2>Articles listed</h2></div>

  	<xsl:apply-templates/>

</xsl:template>

<xsl:template match="orderform">
	<div align="left"><h2>Order Form </h2></div>

	  <xsl:value-of select="."/>
</xsl:template>

<xsl:template match="index">
		<div align="left"><h2>Index </h2></div>

	  <xsl:value-of select="."/>
</xsl:template>

<xsl:template match="description">
	<p>
	<!--  <xsl:value-of select="."/> -->
	</p>
</xsl:template>



<xsl:template match="logo">
	<p>
	 <img src="{.}"></img>
	</p>
</xsl:template>


<xsl:template match="producer">
		<div align="left"><h4>Producer information</h4></div>

  	<xsl:apply-templates select="logo"/>

	 <table border="1" width="800">
	<tr>
      <th>list</th>
     <th>name</th>
     <th>location</th>
     <th>phone</th>
     <th>contact stock</th>
  </tr>
	<tr>
	<td><xsl:number/></td>
 	<td><xsl:value-of select="name"/></td>
 	<td><xsl:value-of select="location"/></td>
 	<td><xsl:value-of select="phone"/></td>
 	<td><xsl:value-of select="contact"/></td>
 	</tr>
   	 </table>
</xsl:template>

<xsl:template match="picture">
	<p>
	 <img src="{.}"></img>
	</p>
</xsl:template>

<xsl:template match="articledata">
	<p>
	  <xsl:value-of select="."/>
	</p>
</xsl:template>

<xsl:template match="rebate">
	<p>Rebate Structure in percent of reduction (one-time rebate):
		 <b>
	  <xsl:value-of select="."/>
		 </b>
	</p>
</xsl:template>

<xsl:template match="delivery">
	<p>
	  <xsl:value-of select="."/>
	</p>
</xsl:template>

<xsl:template match="legal">
	<p>Please take notice of the following legal statement provided by the manufacturer of the article: 	 <b>

	  <xsl:value-of select="."/>
		 </b>

	</p>
</xsl:template>


<xsl:template match="article">
	<div align="left"><h3>Article</h3></div>
  	<xsl:apply-templates select="description"/>

	 <table border="1" width="800">
	<tr>
      <th>list</th>
     <th>ID</th>
     <th>number</th>
     <th>producer</th>
     <th>in stock</th>
     <th>price</th>
  </tr>
  <tr>
	<td><xsl:number/></td>
 	<td><xsl:value-of select="./@id"/></td>
 	<td><xsl:value-of select="articlenumber"/></td>
 	<td><xsl:value-of select="producer/name"/></td>
 	<td><xsl:value-of select="quantity"/></td>
 	<td><xsl:value-of select="price"/></td>
	</tr>
   	 </table>
  	<xsl:apply-templates select="picture"/>

  	<xsl:apply-templates select="articledata"/>
  	<xsl:apply-templates select="rebate"/>
  	<xsl:apply-templates select="delivery"/>
  	<xsl:apply-templates select="legal"/>
  	<xsl:apply-templates select="producer"/>


</xsl:template>



<xsl:template match="catalog">
	<html>
	<head>
		<title>Catalog</title>
	</head>
	<body>
		<div align="center"><h1>Catalog</h1></div>
		<div align="center"><h2><xsl:value-of select="./@ablaufdatum"/></h2></div>

		<xsl:apply-templates select="tableofcontent"/>
		<xsl:apply-templates select="articles"/>
		<xsl:apply-templates select="orderform"/>
		<xsl:apply-templates select="index"/>

	</body>
	</html>
</xsl:template>

<xsl:template match="/">
		<xsl:apply-templates/>
</xsl:template>


<!-- ==================================================================== -->

</xsl:stylesheet>
