You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by cu...@locus.apache.org on 2000/11/03 23:09:01 UTC

cvs commit: xml-xalan/test multiViewResults.xsl resultsConstants.xsl viewResults.bat viewResults.xsl

curcuru     00/11/03 14:09:00

  Added:       test     multiViewResults.xsl resultsConstants.xsl
                        viewResults.bat viewResults.xsl
  Log:
  Simple HTML viewing transforms for XMLFileLogger output from test automation
  
  Revision  Changes    Path
  1.1                  xml-xalan/test/multiViewResults.xsl
  
  Index: multiViewResults.xsl
  ===================================================================
  <?xml version="1.0"?> 
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:output method="html"/>
  
  <!-- FileName: multiViewResults.xsl -->
  <!-- Author: shane_curcuru@lotus.com -->
  <!-- Purpose: Viewer for multiple logFile results put into simple HTML pages -->
  <!-- Usage: ...Process -in ListOfFiles.xml -xsl MultiViewResults.xsl ... -->
  <!-- Where:
      ?xml version="1.0"?
      resultsfilelist fileName="ListOfFiles.xml" desc="Testing 1-2-3"
      resultsfile fileRef="TestResultsOne.xml"
      resultsfile fileRef="TestResultsTwo.xml"
      ...
      /resultsfilelist
  -->
  
  <!-- ======================================================= -->
  <!-- Include the main results viewer for individual result files -->
  <!-- Note: depends on being in the same directory -->
  <xsl:import href="ViewResults.xsl"/>
  
  <!-- ================================== -->
  <!-- Main template: output an HTML page -->
  <!-- The resultfile element must be present.  It should include one or more 
       testfile elements, and may include other elements in some cases.  -->
  <xsl:template match="/resultsfilelist">
    <HTML>
    <HEAD><TITLE><xsl:text>Multiple Test Result list file: </xsl:text><xsl:value-of select="./@fileName"/></TITLE></HEAD>
    <BODY>
      <H1><xsl:text>Multiple Test Results from: </xsl:text><xsl:value-of select="@desc"/></H1>
      <a name="top"><xsl:text>Includes individual resultfile(s):</xsl:text></a>
      <BR />
      <UL>
        <xsl:for-each select="resultsfile">
          <LI>
            <xsl:element name="a">
              <xsl:attribute name="href">#<xsl:value-of select="@fileRef"/></xsl:attribute>
              <xsl:value-of select="@fileRef"/>
            </xsl:element>
          </LI>
        </xsl:for-each>
      </UL>
      <xsl:apply-templates select="resultsfile/@fileRef"></xsl:apply-templates>
  
    </BODY>
    </HTML>
  </xsl:template>
  
  <!-- Select the document of each fileRef, also put in an anchor
       It's much easier to put the anchor in here, since we're assured 
       that the href from above and the anchor here will match. -->
  <xsl:template match="resultsfile/@fileRef">
    <HR size="5" /> 
    <xsl:element name="a">
      <xsl:attribute name="name"><xsl:value-of select="."/></xsl:attribute>
      <xsl:text> </xsl:text>
    </xsl:element>
    <FONT size="-1"><A HREF="#top"><xsl:text>Top of file</xsl:text></A></FONT>
    <xsl:apply-templates select="document(.)"></xsl:apply-templates>
  </xsl:template>
  
  <!-- Just call the included stylesheet to output each individual file -->
  <xsl:template match="resultsfile">
      <xsl:call-template name="mainResultsFile"></xsl:call-template>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  xml-xalan/test/resultsConstants.xsl
  
  Index: resultsConstants.xsl
  ===================================================================
  <?xml version="1.0"?> 
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
      <!-- Misc Constants used within results viewing stylesheets -->
      <xsl:variable name="hash-marker">#hash</xsl:variable>
      <xsl:variable name="file-results-marker">#fr</xsl:variable>
  
      <!-- Constants file for XML results files - copied from Java sources -->
  
      <!-- public static final constants from org.apache.qetest.Logger.java -->
      <xsl:variable name="ERRORMSG">10</xsl:variable>
      <xsl:variable name="FAILSONLY">20</xsl:variable>
      <xsl:variable name="WARNINGMSG">30</xsl:variable>
      <xsl:variable name="STATUSMSG">40</xsl:variable>
      <xsl:variable name="INFOMSG">50</xsl:variable>
      <xsl:variable name="TRACEMSG">60</xsl:variable>
      <xsl:variable name="DEFAULT_LOGGINGLEVEL">STATUSMSG</xsl:variable>
      <xsl:variable name="INCP_RESULT">0</xsl:variable>
      <xsl:variable name="INCP">Incp</xsl:variable>
      <xsl:variable name="PASS_RESULT">2</xsl:variable>
      <xsl:variable name="PASS">Pass</xsl:variable>
      <xsl:variable name="AMBG_RESULT">5</xsl:variable>
      <xsl:variable name="AMBG">Ambg</xsl:variable>
      <xsl:variable name="FAIL_RESULT">8</xsl:variable>
      <xsl:variable name="FAIL">Fail</xsl:variable>
      <xsl:variable name="ERRR_RESULT">9</xsl:variable>
      <xsl:variable name="ERRR">Errr</xsl:variable>
      <xsl:variable name="DEFAULT_RESULT">INCP_RESULT</xsl:variable>
  
      <!-- public static final constants from org.apache.qetest.XMLFileLogger.java -->
      <xsl:variable name="ELEM_RESULTSFILE">resultsfile</xsl:variable>
      <xsl:variable name="ELEM_TESTFILE">testfile</xsl:variable>
      <xsl:variable name="ELEM_FILERESULT">fileresult</xsl:variable>
      <xsl:variable name="ELEM_TESTCASE">testcase</xsl:variable>
      <xsl:variable name="ELEM_CASERESULT">caseresult</xsl:variable>
      <xsl:variable name="ELEM_CHECKRESULT">checkresult</xsl:variable>
      <xsl:variable name="ELEM_STATISTIC">statistic</xsl:variable>
      <xsl:variable name="ELEM_LONGVAL">longval</xsl:variable>
      <xsl:variable name="ELEM_DOUBLEVAL">doubleval</xsl:variable>
      <xsl:variable name="ELEM_MESSAGE">message</xsl:variable>
      <xsl:variable name="ELEM_ARBITRARY">arbitrary</xsl:variable>
      <xsl:variable name="ELEM_HASHTABLE">hashtable</xsl:variable>
      <xsl:variable name="ELEM_HASHITEM">hashitem</xsl:variable>
      <xsl:variable name="ATTR_LEVEL">level</xsl:variable>
      <xsl:variable name="ATTR_DESC">desc</xsl:variable>
      <xsl:variable name="ATTR_TIME">time</xsl:variable>
      <xsl:variable name="ATTR_RESULT">result</xsl:variable>
      <xsl:variable name="ATTR_KEY">key</xsl:variable>
      <xsl:variable name="OPT_LOGFILE">logFile</xsl:variable>
      <xsl:variable name="ATTR_FILENAME">logFile</xsl:variable>
  
      <!-- public static final constants from org.apache.qetest.Reporter.java -->
      <!-- Note manually added the PERF_SEPARATOR on the end of each 
           one for simplicity's sake -->
      <xsl:variable name="TEST_START">TSrt;</xsl:variable>
      <xsl:variable name="TEST_STOP">TStp;</xsl:variable>
      <xsl:variable name="CASE_START">CSrt;</xsl:variable>
      <xsl:variable name="CASE_STOP">CStp;</xsl:variable>
      <xsl:variable name="USER_TIMER">UTmr;</xsl:variable>
      <xsl:variable name="USER_TIMESTAMP">UTim;</xsl:variable>
      <xsl:variable name="USER_MEMORY">UMem;</xsl:variable>
      <xsl:variable name="PERF_SEPARATOR">;</xsl:variable>
  
      <!-- public static final constants from org.apache.qetest.xsl.PerformanceTest.java -->
      <xsl:variable name="PERF_PRELOAD">UPre</xsl:variable>
      <xsl:variable name="PERF_ITERATION">UItr</xsl:variable>
      <xsl:variable name="PERF_AVERAGE">UAvg</xsl:variable>
      <xsl:variable name="PERF_MEMORY">UMem</xsl:variable>
  
  </xsl:stylesheet>
  
  
  
  1.1                  xml-xalan/test/viewResults.bat
  
  Index: viewResults.bat
  ===================================================================
  @echo off
  @goto start
  @REM	Name:   viewResults.bat
  @REM	Author: Shane_Curcuru@lotus.com
  :usage
  @REM ------------------------------------------------------------------------
  :usage
  @echo viewResults.bat - transforms a result.xml into results.html
  @echo   Usage: results results\MyTest.xml [MyResults.html [options]]
  @echo.
  @echo   NOTE:  See runtest.bat for how to set CLASSPATH or JARDIR
  goto done
  @REM ------------------------------------------------------------------------
  
  :start
  @REM must have name of a results.xml file
  if '%1' == '' goto usage
  if '%1' == '-h' goto usage
  if '%1' == '-H' goto usage
  if '%1' == '-?' goto usage
  @echo %0 beginning...
  
  @REM Trickery to guess appropriate location of java.exe program
  if '%JAVA_HOME%' == '' set JAVA_EXE=java
  if not '%JAVA_HOME%' == '' set JAVA_EXE=%JAVA_HOME%\bin\java
  
  @REM Same logic as runtest.bat
  @REM @todo improve so all relevant batch/shell files use same logic -sc
  if '%JARDIR%' == '' echo viewResults.bat must have JARDIR set!
  if '%JARDIR%' == '' goto done
  
  @REM If JARDIR set, put those references first then default classpath
  if not '%JARDIR%' == '' set TEST_CP=%JARDIR%\testxsl.jar;%JARDIR%\xerces.jar;%JARDIR%\xalan.jar;%JARDIR%\bsf.jar;%JARDIR%\js.jar;%CLASSPATH%
  
  @REM Set our output filename
  if '%2' == '' set ROUT=results.html
  if not '%2' == '' set ROUT=%2
  if '%VSXSL%' == '' set VSXSL=viewResults.xsl
                               
  @REM @todo find OS-independent way to send 'all remaining args' instead of just up to %9
  echo %JAVA_EXE% %JAVA_OPTS% -classpath %TEST_CP% org.apache.xalan.xslt.Process -in %1 -xsl %VSXSL% -out %ROUT% %3 %4 %5 %6 %7 %8 %9
  %JAVA_EXE% %JAVA_OPTS% -classpath %TEST_CP% org.apache.xalan.xslt.Process -in %1 -xsl %VSXSL% -out %ROUT% %3 %4 %5 %6 %7 %8 %9
  
  :done
  @echo %0 complete!
  set TEST_CP=
  set JAVA_EXE=
  set ROUT=
  set VSXSL=
  :end
  
  
  
  1.1                  xml-xalan/test/viewResults.xsl
  
  Index: viewResults.xsl
  ===================================================================
  <?xml version="1.0"?> 
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:output method="html"/>
  
  <!-- FileName: viewResults.xsl -->
  <!-- Author: shane_curcuru@lotus.com -->
  <!-- Purpose: Handy viewer for org.apache.qetest.XMLFileLogger
       logFile results put into simple HTML pages -->
  
  <!-- Include constant definitions for results file elements, 
       attributes, and values, copied from relevant Java code -->
  <xsl:include href="resultsConstants.xsl"/>
  
  <!-- ======================================================= -->
  <!-- INPUT PARAMETERS can be set from external command lines -->
  <!-- When set to true, skips (does not) output any checkresult[@result='PASS'] -->
  <xsl:param name="failsonly">false</xsl:param>
  
  <!-- Skip any message[@level&lt;=loggingLevel] -->
  <xsl:param name="loggingLevel">50</xsl:param>
  
  <!-- Only print out a bare summary; nothing else -->
  <xsl:param name="summary">false</xsl:param>
  
  <!-- Cheap color background for errors, fails, and messages likely related thereto -->
  <xsl:param name="errfailcolor">pink</xsl:param>
  
  
  <!-- ================================== -->
  <!-- Main template-standalone: output an HTML page -->
  <!-- The resultfile element must be present.  It should include one or more 
       testfile elements, and may include other elements in some cases.  -->
  <xsl:template match="resultsfile">
    <HTML>
    <HEAD><TITLE><xsl:text>Test Results file: </xsl:text><xsl:value-of select="./@logFile"/></TITLE></HEAD>
    <BODY>
      <!-- TODO: This case is only valid if we have a single testfile!!! -->
      <xsl:call-template name="doResultsFile"/>
    </BODY>
    </HTML>
  </xsl:template>
  
  <!-- ================================== -->
  <!-- Main template-multiple-files: output an HTML page -->
  <!-- The resultfile element must be present.  It should include one or more 
       testfile elements, and may include other elements in some cases.  -->
  <!-- Note that this is only called when MultiViewResults.xsl is including us. --> 
  <xsl:template name="mainResultsFile"> <!-- equivalent match="resultsfile" -->
    <H2><xsl:text>Test Results file: </xsl:text><xsl:value-of select="./@logFile"/></H2>
      <xsl:call-template name="doResultsFile"/>
  </xsl:template>
  
  <xsl:template name="doResultsFile"> <!-- equivalent match="resultsfile" -->
      <!-- We are expecting testfile and hashtable elements.  However a test 
           may also output other elements that we should also report -->
      <xsl:apply-templates select="testfile | hashtable | message | arbitrary | checkresult"/>
  </xsl:template>
  
  <!-- Grab the testfile's name and overall results first, then output the rest -->
  <xsl:template match="testfile">
    <!-- Cache the value of the desc attribute for later use -->
    <xsl:variable name="testfilename" select="@filename"></xsl:variable>
    <H3><B><xsl:text>Testfile: </xsl:text><xsl:value-of select="$testfilename"/>
           <xsl:text> begins: </xsl:text></B><xsl:value-of select="@desc"/></H3>
    <!-- First dump out an overall summary table -->
    <xsl:call-template name="restable">
      <xsl:with-param name="linkname" select="$testfilename"></xsl:with-param>
    </xsl:call-template>
    <!-- Simply skip the rest if we're only doing summary -->
      <xsl:if test="$summary='false'">
        <!-- Optimization: dump most info first; then any testfile-level 
             hashtables at the very end of the report. -->
        <!-- Create a link to the hashtables for this file -->
        <FONT size="-1">
            <xsl:element name="a">
              <xsl:attribute name="href"><xsl:value-of select="$hash-marker"/><xsl:value-of select="$testfilename"/></xsl:attribute>
              <xsl:text>Hashtables and System.properties</xsl:text>
            </xsl:element>
        </FONT>
        <xsl:apply-templates select="testcase | message | arbitrary | checkresult"/>
        <!-- @todo optimize so anchor only appears if there are hashtables -->
        <xsl:element name="a">
          <xsl:attribute name="name"><xsl:value-of select="$hash-marker"/><xsl:value-of select="$testfilename"/></xsl:attribute>
          <xsl:text> </xsl:text><!-- Only need a blank space to anchor to -->
        </xsl:element>
        <xsl:apply-templates select="hashtable"/>
        <H3><B><xsl:text>Testfile (</xsl:text><xsl:value-of select="fileresult/@result"/><xsl:text>) ends: </xsl:text></B>
          <xsl:value-of select="$testfilename"/></H3>
        <FONT size="-1">
          <xsl:element name="a">
            <xsl:attribute name="href"><xsl:value-of select="$file-results-marker"/><xsl:value-of select="$testfilename"/></xsl:attribute>
            <xsl:text>Overall results</xsl:text>
          </xsl:element>
        </FONT>
  
     </xsl:if>
     <P><xsl:text>Test time (milliseconds): </xsl:text><xsl:value-of select="(statistic[starts-with(@desc,$TEST_STOP)]/longval) - (statistic[starts-with(@desc,$TEST_START)]/longval)"/></P>
  </xsl:template>
  
  
  <!-- Process each testcase as a table in HTML -->
  <xsl:template match="testcase">
    <TABLE frame="box" border="1" rules="groups" width="95%" cellspacing="2" cellpadding="5">
    <CAPTION><xsl:text>Testcase begins: </xsl:text><xsl:value-of select="@desc"/></CAPTION>
      <!-- fake row to establish widths -->
      <TR><TD width="20%"></TD><TD width="80%"></TD></TR>
      <!-- It is illegal for a testcase to contain another testcase, so don't bother 
           selecting them: however you must check for every other kind of item -->
      <xsl:apply-templates select="message | arbitrary | checkresult | hashtable"/>
      <TR><TD></TD><TD><xsl:text>Case time (milliseconds): </xsl:text>
      <xsl:value-of select="(statistic[starts-with(@desc,$CASE_STOP)]/longval) - (statistic[starts-with(@desc,$CASE_START)]/longval)"/></TD></TR>
      <!-- Print out the overall caseresult at the end -->
      <xsl:apply-templates select="caseresult"/>
    </TABLE>
  </xsl:template>
  
  <!-- Note: must match values in XMLFileReporter for attributes and values! -->
  <!-- Different processing for different kinds of results -->
  <xsl:template match="checkresult[@result=$FAIL] | checkresult[@result=$ERRR]">
    <TR><TD bgcolor="{$errfailcolor}"><B><xsl:value-of select="@result"/></B></TD><TD><xsl:value-of select="@desc"/></TD></TR>
  </xsl:template>
  
  <xsl:template match="checkresult[@result=$AMBG]">
    <TR><TD><I><xsl:value-of select="@result"/></I></TD><TD><xsl:value-of select="@desc"/></TD></TR>
  </xsl:template>
  
  <xsl:template match="checkresult[@result=$INCP]">
    <TR><TD><I><xsl:value-of select="@result"/></I></TD><TD><xsl:value-of select="@desc"/></TD></TR>
  </xsl:template>
  
  <!-- If users want a 'condensed' report, set failsonly=true, and then we skip all pass records -->
  <xsl:template match="checkresult[@result=$PASS]">
    <xsl:if test="$failsonly='false'">
      <TR><TD><xsl:value-of select="@result"/></TD><TD><xsl:value-of select="@desc"/></TD></TR>
    </xsl:if>
  </xsl:template>
  
  <!-- Differentiate results that are not within a testcase! 
       These get their own table element so they stand out.  Also, 
       use trickery: the more specific template should be called for 
       Errr or Fail results below. -->
  <xsl:template match="checkresult[parent::resultsfile or parent::testfile]">
    <TABLE frame="box" border="1" width="80%" cellspacing="1"><TR><TD><B><xsl:value-of select="@result"/></B></TD><TD><xsl:value-of select="@desc"/></TD></TR></TABLE>
  </xsl:template>
  <xsl:template match="checkresult[@result=$FAIL or @result=$ERRR][parent::resultsfile or parent::testfile]">
    <TABLE frame="box" border="1" width="80%" cellspacing="1"><TR><TD bgcolor="red"><B><xsl:value-of select="@result"/></B></TD><TD><xsl:value-of select="@desc"/></TD></TR></TABLE>
  </xsl:template>
  
  <!-- Only print out messages that are below or equal to our logging level -->
  <!-- Note we should 'prettify' these when they're not within a testcase -->
  <xsl:template match="message[@level&lt;=$loggingLevel]">
    <xsl:choose>
    <!-- Special processing when it's outside of a testcase! -->
      <xsl:when test="parent::resultsfile or parent::testfile">
        <TABLE frame="box" border="1" width="80%" cellspacing="1">
        <xsl:call-template name="othermessage"/>
        </TABLE>
      </xsl:when>
    <!-- Otherwise, different processing when it's related to a fail or error -->
      <xsl:when test="following-sibling::checkresult[position()=1]/@result=$ERRR">
        <xsl:call-template name="errfailmessage"/>
      </xsl:when>
      <xsl:when test="following-sibling::checkresult[position()=1]/@result=$FAIL">
        <xsl:call-template name="errfailmessage"/>
      </xsl:when>
      <xsl:otherwise>
        <xsl:call-template name="othermessage"/>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:template>
  
  <!-- For messages, change the font size based on the level (which equates to importance) -->
  <xsl:template name="othermessage">
    <TR>
    <xsl:choose>
      <xsl:when test="@level&lt;=$FAILSONLY">
      <TD><FONT size="+1"><xsl:value-of select="@level"/></FONT></TD><TD><FONT size="+1"><xsl:value-of select="."/></FONT></TD>
      </xsl:when>
      <xsl:when test="@level&gt;=$INFOMSG">
      <TD><FONT size="-1"><xsl:value-of select="@level"/></FONT></TD><TD><FONT size="-1"><xsl:value-of select="."/></FONT></TD>
      </xsl:when>
      <xsl:otherwise>
      <TD><xsl:value-of select="@level"/></TD><TD><xsl:value-of select="."/></TD>
      </xsl:otherwise>
    </xsl:choose>
    </TR>
  </xsl:template>
  
  <!-- Messages related to errors or fails get a special background -->
  <xsl:template name="errfailmessage">
    <TR>
    <xsl:choose>
      <xsl:when test="@level&lt;=$FAILSONLY">
      <TD bgcolor="{$errfailcolor}"><FONT size="+1"><xsl:value-of select="@level"/></FONT></TD><TD><FONT size="+1"><xsl:value-of select="."/></FONT></TD>
      </xsl:when>
      <xsl:when test="@level&gt;=$INFOMSG">
      <TD bgcolor="{$errfailcolor}"><FONT size="-1"><xsl:value-of select="@level"/></FONT></TD><TD><FONT size="-1"><xsl:value-of select="."/></FONT></TD>
      </xsl:when>
      <xsl:otherwise>
      <TD bgcolor="{$errfailcolor}"><xsl:value-of select="@level"/></TD><TD><xsl:value-of select="."/></TD>
      </xsl:otherwise>
    </xsl:choose>
    </TR>
  </xsl:template>
  
  
  <!-- Likewise print out any arbitrary messages that are below or equal to our logging level -->
  <!-- TODO: handle case where arbitrary is not a child of a testcase (which has a TABLE element already) -->
  <xsl:template match="arbitrary[@level&lt;=$loggingLevel]">
    <TR><TD><FONT size="-1"><xsl:value-of select="@level"/></FONT></TD><TD><I><xsl:value-of select="."/></I></TD></TR>
  </xsl:template>
  
  <xsl:template match="caseresult">
    <TR><TD><xsl:text>----></xsl:text></TD><TD><xsl:text>Testcase result: </xsl:text><FONT size="+1"><xsl:value-of select="@result"/></FONT></TD></TR>
  </xsl:template>
  
  <!-- Dump hashtables and etc. FIXME: make settable so these can go at the end of a report -->
  <!-- FIXME: have it simply call a hashitem template directly, since we know there 
       shouldn't be anything else in a hashtable besides hashitems...  -->
  <xsl:template match="hashtable">
    <BR/><FONT size="-1"><xsl:text>Hashtable logged: </xsl:text><xsl:value-of select="@desc"/></FONT>
    <TABLE border="1" width="80%" cellspacing="1" cellpadding="2">
      <xsl:apply-templates select="hashitem"/>
    </TABLE>
  </xsl:template>
  
  <xsl:template match="hashitem">
    <TR><TD><xsl:value-of select="@key"/></TD><TD><xsl:value-of select="."/></TD></TR>
  </xsl:template>
  
  <!-- Special processing for java.class.path! This, more specific template must be after the generic one -->
  <xsl:template match="hashitem[@key='java.class.path']">
    <TR><TD bgcolor="yellow"><xsl:value-of select="@key"/></TD><TD><xsl:value-of select="."/></TD></TR>
    <TR><TD bgcolor="yellow"></TD><TD><xsl:call-template name="ClasspathItems"></xsl:call-template></TD></TR>
  </xsl:template>
  
  <!-- Output the special messages that the Harness outputs showing which exact
       JARS it found on the actual classpath at runtime.  Note this is not terribly 
       efficient, and it may not be applicable to single test output. -->
  <xsl:template name="ClasspathItems">
    <P><xsl:text>ClasspathItems found (when applicable): </xsl:text><BR/>
    <xsl:for-each select="//testfile/message[starts-with(.,'ClasspathItem')]">
      <xsl:value-of select="."/><BR/>
    </xsl:for-each></P>
  </xsl:template>
  
  <!-- Print an overall summary of pass/fail numbers.  Note that these are 
       grabbed from the testfile's statistics, and not actually counted as we parse. 
       This template is presumably called from the testfile level. -->
  
  <xsl:template name="restable">
    <xsl:param name="linkname" select="none"/>
    <TABLE FRAME="box" BORDER="1" CELLPADDING="2" WIDTH="80%">
    <TR><TD>
    <xsl:element name="a">
      <xsl:attribute name="name"><xsl:value-of select="$file-results-marker"/><xsl:value-of select="$linkname"/></xsl:attribute>
      <B><xsl:text>Overall Result: </xsl:text></B>
    </xsl:element>
    <xsl:value-of select="fileresult/@result"/></TD><TD><B><xsl:text>Test Cases</xsl:text></B></TD><TD><B><xsl:text>Test Points</xsl:text></B><xsl:text> "checks"</xsl:text></TD></TR>
  
    <xsl:if test="./statistic[@desc='passCount[CASES]'] or statistic[@desc='passCount[CHECKS]']">
      <TR><TD><xsl:text>Pass</xsl:text></TD><TD><xsl:value-of select="./statistic[@desc='passCount[CASES]']/longval"/></TD>
        <TD><xsl:value-of select="statistic[@desc='passCount[CHECKS]']/longval"/></TD></TR>
    </xsl:if>
    <xsl:if test="./statistic[@desc='failCount[CASES]'] or statistic[@desc='failCount[CHECKS]']">
    <TR><TD><B><xsl:text>Fail</xsl:text></B></TD><TD><xsl:value-of select="./statistic[@desc='failCount[CASES]']/longval"/></TD>
        <TD><xsl:value-of select="statistic[@desc='failCount[CHECKS]']/longval"/></TD></TR>
    </xsl:if>
    <xsl:if test="./statistic[@desc='errrCount[CASES]'] or statistic[@desc='errrCount[CHECKS]']">
    <TR><TD><I><xsl:text>Error</xsl:text></I></TD><TD><xsl:value-of select="./statistic[@desc='errrCount[CASES]']/longval"/></TD>
        <TD><xsl:value-of select="statistic[@desc='errrCount[CHECKS]']/longval"/></TD></TR>
    </xsl:if>
    <xsl:if test="./statistic[@desc='ambgCount[CASES]'] or statistic[@desc='ambgCount[CHECKS]']">
    <TR><TD><I><xsl:text>Ambiguous</xsl:text></I></TD><TD><xsl:value-of select="./statistic[@desc='ambgCount[CASES]']/longval"/></TD>
        <TD><xsl:value-of select="statistic[@desc='ambgCount[CHECKS]']/longval"/></TD></TR>
    </xsl:if>
    <xsl:if test="./statistic[@desc='incpCount[CASES]'] or statistic[@desc='incpCount[CHECKS]']">
    <TR><TD><I><xsl:text>Incomplete</xsl:text></I></TD><TD><xsl:value-of select="./statistic[@desc='incpCount[CASES]']/longval"/></TD>
        <TD><xsl:value-of select="statistic[@desc='incpCount[CHECKS]']/longval"/></TD></TR>
    </xsl:if>
    </TABLE><BR/>
  </xsl:template>
  
  <!-- Override default text node processing, so statistics, arbitrary messages, and other stuff is skipped -->
  <xsl:template match="text()"></xsl:template>
  
  </xsl:stylesheet>