template.xsl 2.26 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="html" version="4" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
    <!-- main body -->
    <xsl:template match="/">
        <html>
          <body>
            <h3>TEMPLATE Results Summary</h3>
            <table border="1">
              <tr bgcolor="lightcyan">
                <!--Header only so select first row to get headers-->
                  <th>Hostname</th>
                  <th>Nb Tests</th>
                  <th>Failures</th>
                  <th>Timestamp</th>
              </tr>
              <!--Get all the other rows-->
              <xsl:for-each select="testsuites/testsuite">
                <tr>
                    <td>
                      <xsl:value-of select="@hostname"/>
                    </td>
                    <td>
                      <xsl:value-of select="@tests"/>
                    </td>
                    <td>
                      <xsl:value-of select="@failures"/>
                    </td>
                    <td>
                      <xsl:value-of select="@timestamp"/>
                    </td>
                </tr>
              </xsl:for-each>
              </table>
            <h4>Details</h4>
            <table border="1">
              <tr bgcolor="lightcyan">
                <!--Header only so select first row to get headers-->
                  <th>Test Name</th>
                  <th>Result</th>
                  <th>Time</th>
42
                  <th>Description</th>
43 44 45 46 47 48 49 50 51 52 53 54 55
              </tr>
              <!--Get all the other rows-->
              <xsl:for-each select="testsuites/testsuite/testcase">
                <tr>
                    <td>
                      <xsl:value-of select="@name"/>
                    </td>
                    <td>
                      <xsl:value-of select="@RESULT"/>
                    </td>
                    <td>
                      <xsl:value-of select="@time"/>
                    </td>
56 57 58
                    <td>
                      <xsl:value-of select="@description"/>
                    </td>
59 60 61 62 63 64 65
                </tr>
              </xsl:for-each>
              </table>
          </body>
        </html>
    </xsl:template>
</xsl:stylesheet>