<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
	       xmlns="http://www.w3.org/1999/xhtml">

  <xsl:template match="bugzilla">
    <html>
      <head>
	<title>Disposition of comments</title>
	<link rel="stylesheet" type="text/css" href="http://www.w3.org/StyleSheets/base.css"/>
	<link rel="stylesheet" type="text/css" href="http://www.w3.org/2003/03/site-css/css/1.css"/>
	<style type="text/css">
	  pre {font-size: small; background-color: lightgrey}
	</style>
      </head>
      <body>
	<h1><xsl:value-of select="bug[1]/component"/><br/>Disposition of Comments</h1>
	<xsl:apply-templates select="bug"/>
      </body>
    </html>
  </xsl:template>
  
  <xsl:template match="bug">
    <h2>
      <xsl:if test="bug_status[.='RESOLVED']">
	<xsl:attribute name="style">text-decoration: line-through</xsl:attribute>
      </xsl:if>
    <xsl:value-of select="bug_id"/>: <xsl:apply-templates select="short_desc"/>
    </h2>
    <p>Status: <xsl:value-of select="bug_status"/>
    <xsl:if test="bug_status[.='RESOLVED']">
      <xsl:value-of select="concat(' (',resolution,')')"/>
    </xsl:if>
    </p>
    <p><small> Raised by: <xsl:value-of select="reporter"/> on <xsl:value-of select="creation_ts"/></small><br/></p>
   

    <h3>Comment</h3>
    <pre><xsl:apply-templates select="long_desc[1]/thetext"/></pre>


    <xsl:choose>
      <xsl:when test="bug_status[.='RESOLVED']">
	<h3>Discussion</h3>
	<xsl:apply-templates select="long_desc[position() &gt; 1 and position() &lt; last()]"/>
	<h3>Resolution</h3>
	<xsl:apply-templates select="long_desc[position()=last()]"/>
      </xsl:when>
      <xsl:otherwise>
	<h3>Discussion</h3>
	<xsl:apply-templates select="long_desc[position() &gt; 1]"/>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:template>

  <xsl:template match="long_desc">
    <h4><xsl:apply-templates select="who"/> - <xsl:apply-templates select="bug_when"/></h4>
    <pre><xsl:apply-templates select="thetext"/></pre>
  </xsl:template>



</xsl:transform>


