<?xml version="1.0"?>

<!-- 	coin78 online class
	Final Project
	by Yih-Ling Liu
	table.xsl
	**tranfer layout.xml into table.html**
	**xml to html**
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.1">

<xsl:template match="/">
  <html>
    <head><title>Herb Table using XSL</title></head>	 
    <body>
      <xsl:apply-templates />
    </body>
  </html>
</xsl:template>

<xsl:template match="herbs">
  <h2 align="center">Herb List</h2>
    <table align="center" border="1">
      <tr valing="top">
    	<th>Common Name</th>
	<th>Type</th>
	<th>Position</th>
	<th>Soil</th>
	<th>Propagation</th>
	<th>Parts</th>
	<th>Uses</th>
      </tr>	
    <xsl:for-each select="/herbs/herb">
      <tr valign="top">
        <td><xsl:value-of select="plant/name/common_name"/></td>
        <td><xsl:value-of select="fact/type/info_type"/></td>
        <td><xsl:value-of select="fact/position/info_pos"/></td>
        <td><xsl:value-of select="fact/soil/info_soil"/></td>
        <td><xsl:value-of select="fact/propagation/info_prop"/></td>
        <td><xsl:value-of select="fact/parts/info_parts"/></td>
        <td><xsl:value-of select="fact/uses/info_uses"/></td>
      </tr>
    </xsl:for-each>
 </table>
</xsl:template>
</xsl:stylesheet>

