<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/XSL/Transform/1.0">

  <xsl:variable name="titel">Buglist Software Version Control</xsl:variable>

  <xsl:template match="*|@*">
    <b>Not yet Functional: <xsl:value-of select="."/></b>
  </xsl:template>

  <xsl:template match="/">
    <html>
      <head>
         <title><xsl:value-of select="$titel"/>: <xsl:value-of select="softpkg/name"/></title>
      </head>
      <body bgcolor="white">        
	<xsl:apply-templates/>
	
        <p align="center"><i><xsl:value-of select="$titel"/></i></p>
      </body>
    </html>
  </xsl:template>
  
  <xsl:template match="softpkg">
    <h3><xsl:value-of select="name"/></h3>
    <xsl:if test="./abstract">
      <p><b><i>Abstract:</i></b>: <xsl:apply-templates select="./abstract"/></p>
    </xsl:if>
  
    <xsl:if test="buglist">
      <h3>Buglist</h3>
      <xsl:for-each select="buglist//bug">
        <xsl:sort select="./@id"/>
	<ul><xsl:apply-templates select="."/></ul>
      </xsl:for-each>
    </xsl:if>  
  </xsl:template>

  <xsl:template match="bug">
    <li/><i>Bug #</i><xsl:value-of select="./@id"/><br/>
    <xsl:apply-templates/>
  </xsl:template>  

  <!-- the next elements are html elements and should be passed on -->

  <xsl:template match="bug//*">
     <xsl:copy>
       <xsl:apply-templates select="@*|node()"/>
     </xsl:copy>  
  </xsl:template>

  <xsl:template match="bug//*/@*">
     <xsl:copy>
       <xsl:apply-templates select="@*|node()"/>
     </xsl:copy>  
  </xsl:template>

</xsl:stylesheet>
