<?xml version="1.0" encoding="ISO-8859-1"?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/">
  <html>
  <body>
  <h2><xsl:value-of select="catalog/title"/></h2>
  <table border="1">
   <tr>
  <xsl:for-each select="catalog/plant[1]/*">
        <th><xsl:value-of select="name()"/></th>
 </xsl:for-each>
      </tr>
     
      <xsl:choose>
          <xsl:when test="//harvest">
	   <xsl:for-each select="catalog/plant">
            <tr>
        <td><xsl:value-of select="name"/></td>
	<td><xsl:value-of select="latin"/></td>
	<td><xsl:value-of select="price"/></td>
	<td><xsl:value-of select="height"/></td>
	<td><xsl:value-of select="harvest"/></td>
        <td><xsl:value-of select="condition"/></td>
	<td><img>
		<xsl:attribute name="src"><xsl:value-of select="//@src" /><xsl:value-of      
		select="image" /></xsl:attribute>
	    </img>
	</td>
      </tr>
       </xsl:for-each>
          </xsl:when>
          <xsl:otherwise>
             <xsl:for-each select="catalog/plant">
            <tr>
        <td><xsl:value-of select="name"/></td>
	<td><xsl:value-of select="latin"/></td>
	<td><xsl:value-of select="price"/></td>
	<td><xsl:value-of select="height"/></td>
	<td><xsl:value-of select="season"/></td>
        <td><xsl:value-of select="condition"/></td>
	<td><img>
		<xsl:attribute name="src"><xsl:value-of select="//@src" /><xsl:value-of      
		select="image" /></xsl:attribute>
	    </img>
	</td>
      </tr>
       </xsl:for-each>

          </xsl:otherwise>
        </xsl:choose>

      
     
    </table>
  </body>
  </html>
</xsl:template>
</xsl:stylesheet>


