Skip to main content

Source code file content

Revision: 114

» Project Revision History

» Checkout URL

soatestingutilities / ConsolidatedTestEnv / report2html.xsl

Size: 1849 bytes, 1 line
<?xml version="1.0" encoding="windows-1252" ?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output method="html" indent="yes"/>
  <xsl:template match="/">
    <html> 
      <head>
        <title>Test Report of <xsl:value-of select="/test-report/@date"/></title>
      </head>
      <body>
        <h1>Test Report, <xsl:value-of select="/test-report/@date"/></h1>
        <p>
          <ul>
            <li type="disc">Total number of tests: <xsl:value-of select="count(/test-report/test)"/></li>
            <li type="disc">Total number of success: <xsl:value-of select="count(/test-report/test[testsuite/@errors = '0' and testsuite/@failures = '0'])"/></li>
            <li type="disc">Total number of failures: <xsl:value-of select="count(/test-report/test[testsuite/@errors= '1' or testsuite/@failures = '1'])"/></li>
          </ul>
        </p>
        <hr/>
        <xsl:for-each select="/test-report/test">
          <h2>Test <xsl:value-of select="./testsuite/@name"/></h2>
          <xsl:choose>
            <xsl:when test="./testsuite/@errors = '0' and ./testsuite/@failures = '0'">
              <h2><font color="green">Success</font></h2>
            </xsl:when>
            <xsl:otherwise>
              <h2><font color="red">Failed</font></h2>
              <p>
                Error message:
                <pre>
                  <xsl:value-of select="./testsuite/system-err"/>
                </pre>
                <hr/>
              </p>
            </xsl:otherwise>
          </xsl:choose>
          Test Output:
          <pre>
            <xsl:value-of select="./testsuite/system-out"/>
          </pre>
          <hr/>
        </xsl:for-each>
        <address>Proudly created by the A-Team</address>
      </body>
    </html>
  </xsl:template>
</xsl:stylesheet>
 
 
Close
loading
Please Confirm
Close