<?xml version="1.0"?>

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

   <xsl:template match="card_list">
     <html><head><title>Card Listing</title></head>
     <body bgcolor="WHITE">
     <table border="0" width="95%" bgcolor="WHITE">
         <tr><td colspan="4" bgcolor="#FFFFCC"><h1><font color="BLUE"><xsl:value-of select="@name"/></font></h1></td></tr>
         <tr><td colspan="4" bgcolor="#FFFFCC"><xsl:apply-templates select="p"/><br/></td></tr>
         <xsl:apply-templates select="card_group|history"/>
     </table>
     </body>
     </html>
   </xsl:template>

   <xsl:template match="card_group">
      <tr bgcolor="#FFFFCC"><td colspan="4"><h2><font color="BLUE"><xsl:value-of select="@name"/></font></h2></td></tr>
      <tr bgcolor="#FFFFCC"><td colspan="4"><xsl:apply-templates select="p"/><br/></td></tr>
      <xsl:apply-templates select="card"/>
   </xsl:template>

   <xsl:template match="history">
      <table border="0" width="95%" bgcolor="#000000">
         <tr bgcolor="#FFFFCC"><td colspan="4"><h2><font color="BLUE">Revision History</font></h2></td></tr>
         <xsl:apply-templates select="revision"/>
      </table>
   </xsl:template>

   <xsl:template match="card">
      <tr>
          <td bgcolor="#FFFFCC" rowspan="2"><font color="BLUE"><xsl:value-of select="@name"/></font></td>
          <td bgcolor="#FFFFCC"><font color="BLUE">chipset: <xsl:value-of select="@chip"/></font></td>
          <td bgcolor="#FFFFCC"><font color="BLUE">bus: <xsl:value-of select="@bus"/></font></td>
          <td bgcolor="#FFFFCC"><font color="BLUE">memory: <xsl:value-of select="@mem"/></font></td>
      </tr>
      <tr>
          <td bgcolor="#FFFFCC"><font color="BLUE">PCI ID: <xsl:value-of select="@id"/></font></td>
          <td bgcolor="#FFFFCC"><font color="BLUE">Subsys ID: <xsl:value-of select="@subsys_id"/></font></td>
          <td bgcolor="#FFFFCC"><font color="BLUE">Platform: <xsl:value-of select="@arch"/></font></td>
      </tr>

      <tr><td colspan="4">
      <xsl:apply-templates select="pictures"/>
      <xsl:apply-templates select="p"/><br/>
      </td></tr>
   </xsl:template>
   
   <xsl:template match="pictures">
       <table border="0">
           <tr><xsl:apply-templates select="pic"/></tr>
       </table>
   </xsl:template>

   <xsl:template match="pic">
       <td><a href="{@name}.jpg"><img src="{@name}.thumb.jpg" width="200"/></a></td>
   </xsl:template>

   <xsl:template match="revision">
      <tr bgcolor="WHITE">
          <td><font color="BLACK"><xsl:value-of select="@date"/></font></td>
	  <td><xsl:apply-templates select="p"/></td>
      </tr>
   </xsl:template>

   <xsl:template match="p">
      <p><font color="BLACK"><xsl:copy-of select="*|text()"/></font></p>
   </xsl:template>

</xsl:stylesheet>
