home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / share / checkbox / report / checkbox.xsl < prev   
Encoding:
Extensible Markup Language  |  2009-04-27  |  5.3 KB  |  155 lines

  1. <?xml version="1.0"?>
  2. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  3. <xsl:template match="/">
  4.     <html>
  5.     <head>
  6.         <title>Checkbox Report</title>
  7.         <link rel="stylesheet" type="text/css" href="file:///usr/share/checkbox/report/checkbox.css" media="all" />
  8.     </head>
  9.     <body>
  10.     <h1>Checkbox Report</h1>
  11.     <h2 id="toc">Table Of Contents</h2>
  12.     <ol>
  13.         <li><a href="#summary">Summary</a></li>
  14.         <li>Hardware
  15.         <ul>
  16.             <li><a href="#hal">HAL</a></li>
  17.             <li><a href="#processors">Processors</a></li>
  18.         </ul></li>
  19.         <li>Software
  20.         <ul>
  21.             <li><a href="#packages">Packages</a></li>
  22.             <li><a href="#lsb_release">LSB</a></li>
  23.         </ul></li>
  24.         <li><a href="#questions">Questions</a></li>
  25.         <li><a href="#context">Contextual Information</a></li>
  26.         <xsl:apply-templates select=".//context" mode="navigation" />
  27.      </ol>
  28.     <xsl:apply-templates select=".//summary" />
  29.     <xsl:apply-templates select=".//hardware/hal" />
  30.     <xsl:apply-templates select=".//hardware/processors" />
  31.     <xsl:apply-templates select=".//hardware/lspci" />
  32.     <xsl:apply-templates select=".//software/packages" />
  33.     <xsl:apply-templates select=".//software/lsb_release" />
  34.     <xsl:apply-templates select=".//questions" />
  35.     <xsl:apply-templates select=".//context" />
  36.     </body>
  37.     </html>
  38. </xsl:template>
  39.  
  40. <xsl:template match="summary">
  41.     <h2 id="summary">Summary</h2>
  42.     <p>This report was created using <xsl:value-of select="client/@name" /> <xsl:text> </xsl:text><xsl:value-of select="client/@version" /> on <xsl:value-of select="date_created/@value" />, on <xsl:value-of select="distribution/@value" /><xsl:text> </xsl:text><xsl:value-of select="distroseries/@value" /> (<xsl:value-of select="architecture/@value" />).</p>
  43.     <p>You can view other reports for this system <a href="https://launchpad.net/+hwdb/+fingerprint/{system_id/@value}">here</a>.</p>
  44. </xsl:template>
  45.  
  46. <xsl:template match="hardware/hal">
  47.     <h2 id="hal">HAL</h2>
  48.     <xsl:for-each select="device">
  49.         <h3><xsl:value-of select='property[@name="info.product"]' /></h3>
  50.         <table>
  51.             <tr>
  52.                 <th>Property</th>
  53.                 <th>Value</th>
  54.             </tr>
  55.         <xsl:for-each select="property">  
  56.             <tr>
  57.                 <td class="label"><xsl:value-of select="@name" /></td>
  58.                 <td class="property"><xsl:value-of select="." /></td>
  59.             </tr>
  60.         </xsl:for-each>
  61.         </table>
  62.     </xsl:for-each>
  63.     <p class="navigation"><a href="#toc">Back to Table of Contents</a></p>
  64. </xsl:template>
  65.  
  66. <xsl:template match="hardware/processors">
  67.     <h2 id="processors">Processors</h2>
  68.     <xsl:for-each select="processor">
  69.         <h3><xsl:value-of select='@name' /></h3>
  70.         <table>
  71.             <tr>
  72.                 <th>Property</th>
  73.                 <th>Value</th>
  74.             </tr>
  75.         <xsl:for-each select="property">  
  76.             <tr>
  77.                 <td class="label"><xsl:value-of select="@name" /></td>
  78.                 <td class="property"><xsl:value-of select="." /></td>
  79.             </tr>
  80.         </xsl:for-each>
  81.         </table>
  82.     </xsl:for-each>
  83.     <p class="navigation"><a href="#toc">Back to Table of Contents</a></p>
  84. </xsl:template>
  85.  
  86. <xsl:template match="software/packages">
  87.     <h2 id="packages">Packages</h2>
  88.     <table>
  89.         <tr>
  90.             <th>Name</th>
  91.             <th>Version</th>
  92.         </tr>
  93.         <xsl:for-each select="package">
  94.             <tr>
  95.                 <td class="label"><xsl:value-of select="@name" /></td>
  96.                 <td><xsl:value-of select="property" /></td>
  97.             </tr>
  98.         </xsl:for-each>
  99.     </table>
  100.     <p class="navigation"><a href="#toc">Back to Table of Contents</a></p>
  101. </xsl:template>
  102.  
  103. <xsl:template match="software/lsb_release">
  104.     <h2 id="lsb_release">LSB</h2>
  105.     <table>
  106.         <xsl:for-each select="property">
  107.             <tr>
  108.                 <td class="label"><xsl:value-of select="@name" /></td>
  109.                 <td><xsl:value-of select="." /></td>
  110.             </tr>
  111.         </xsl:for-each>
  112.     </table>
  113.     <p class="navigation"><a href="#toc">Back to Table of Contents</a></p>
  114. </xsl:template>
  115.  
  116. <xsl:template match="questions">
  117.     <h2 id="questions">Questions</h2>
  118.         <table>
  119.         <tr>
  120.             <th>Name</th>
  121.             <th>Answer</th>
  122.             <th>Comment</th>
  123.         </tr>
  124.         <xsl:for-each select="question">
  125.             <tr>
  126.                 <td class="label"><xsl:value-of select="@name" /></td>
  127.                 <td><xsl:value-of select="answer" /></td>
  128.                 <td><xsl:value-of select="comment" /></td>
  129.             </tr>
  130.         </xsl:for-each>
  131.     </table>
  132.     <p class="navigation"><a href="#toc">Back to Table of Contents</a></p>
  133. </xsl:template>
  134.  
  135. <xsl:template match="context" mode="navigation">
  136.     <ul>
  137.     <xsl:for-each select="info">
  138.         <li>
  139.             <a href="#{generate-id(.)}"><xsl:value-of select="@command" /></a>
  140.         </li>
  141.     </xsl:for-each>
  142.     </ul>
  143. </xsl:template>
  144.  
  145. <xsl:template match="context">
  146.     <h2 id="context">Contextual Information</h2>
  147.     <xsl:for-each select="info">
  148.         <h3 id="{generate-id(.)}"><xsl:value-of select="@command" /></h3>
  149.         <pre><xsl:value-of select="." /></pre>
  150.         <p class="navigation"><a href="#toc">Back to Table of Contents</a></p>
  151.     </xsl:for-each>
  152. </xsl:template>
  153.  
  154. </xsl:stylesheet>
  155.