File: CoverageLog.xsl

package info (click to toggle)
dart 0.20020805-2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 3,688 kB
  • ctags: 172
  • sloc: tcl: 4,979; perl: 213; makefile: 61; cpp: 42; sh: 2
file content (66 lines) | stat: -rw-r--r-- 2,744 bytes parent folder | download
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    version="1.0"
    xmlns:lxslt="http://xml.apache.org/xslt"
    xmlns:redirect="org.apache.xalan.lib.Redirect"
    extension-element-prefixes="redirect">

  <!--
       Use DashboardStamp as a parameter, default to most recent
       The proper flags to Xalan are in the form -PARAM DashboardStamp "string('foo')"
       -->
 <xsl:param name="DashboardPath"/> 
 <xsl:param name="DashboardStamp" select="string('MostRecentResults-Nightly')"/>
 <xsl:param name="TestDocDir">.</xsl:param>
 <xsl:variable name="DashboardDir" select="concat('../../../../Dashboard/', $DashboardStamp)"/>
 <xsl:variable name="IconDir">../../../../Icons</xsl:variable>
 <xsl:include href="DashboardConfig.xsl"/>
 <xsl:output method="html"/>

  <xsl:template match="/">
    <xsl:for-each select="Site/CoverageLog/File">

    <redirect:write select="concat(string('{$TestDocDir}'), '/../Coverage/', translate ( @FullPath, '/.', '__' ), '.html' )" file="dan.html">
      <xsl:call-template name="DashboardHeader">
        <xsl:with-param name="Title">Annotated Coverage for <xsl:value-of select="@Name"/></xsl:with-param>
        <xsl:with-param name="IconDir">../../../../Icons</xsl:with-param>
        <xsl:with-param name="DashboardDir" select="$DashboardDir"/>
      </xsl:call-template>
        <b>Site Name: </b> <xsl:value-of select="/Site/@Name"/>
      <p>
        <b>Build Name: </b> <xsl:value-of select="/Site/@BuildName"/>
      </p>
      <p>
        <b>Coverage Date: </b> <xsl:value-of select="/Site/CoverageLog/StartDateTime"/>
      </p>

      <hr/>
      <pre>
        <xsl:for-each select="Report/Line">
          <xsl:sort select="@Number" data-type="number"/>
          <xsl:choose>
            <xsl:when test="@Count &lt; 0">
              <xsl:text disable-output-escaping="yes"><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;]]></xsl:text>
            </xsl:when>
            <xsl:when test="@Count = 0">
              <xsl:text disable-output-escaping="yes"><![CDATA[########]]></xsl:text>
            </xsl:when>
            <xsl:otherwise>
              <xsl:value-of select="format-number ( @Count, '00000000' )"/>
            </xsl:otherwise>
          </xsl:choose>

          <xsl:text disable-output-escaping="yes"><![CDATA[&nbsp;&nbsp;]]></xsl:text>
          <xsl:value-of select="."/>
        <xsl:text disable-output-escaping="yes">
</xsl:text>
        </xsl:for-each>
      </pre>
      <xsl:call-template name="DashboardFooter">
	<xsl:with-param name="IconDir">../../../../Icons</xsl:with-param>
      </xsl:call-template>
    </redirect:write> 
    </xsl:for-each>
  </xsl:template>

</xsl:stylesheet>