forked from w3c/exi-testsuite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgenerate-table.xsl
62 lines (53 loc) · 2.49 KB
/
generate-table.xsl
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
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:japex="http://www.sun.com/japex/testSuiteReport"
exclude-result-prefixes="xs japex" version="2.0">
<xsl:output method="xml"
cdata-section-elements="script style"
indent="yes"
encoding="utf-8"
doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" />
<xsl:template match="/">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title><xsl:value-of select="japex:testSuiteReport/@name"/></title>
<style type="text/css">
body {color: black; background: white;}
.pass { background-color: #00aa00; }
.fail { background-color: #aa0000; }
th { background-color: grey; }
</style>
</head>
<body>
<div class="testreport">
<h1>Interoperability Test Report</h1>
<p><xsl:value-of select="japex:testSuiteReport/japex:configFile"/></p>
<p><xsl:value-of select="japex:testSuiteReport/japex:dateTime"/></p>
<table>
<tbody>
<xsl:for-each select="japex:testSuiteReport/japex:driver">
<tr><th><xsl:value-of select="@name" /></th><th></th></tr>
<xsl:apply-templates select="japex:testCase" />
</xsl:for-each>
</tbody>
</table>
</div>
</body>
</html>
</xsl:template>
<xsl:template match="japex:testCase">
<tr xmlns="http://www.w3.org/1999/xhtml" class="testcase">
<!-- <td><xsl:value-of select="@name"/></td> -->
<td><xsl:value-of select="japex:inputFile"/></td>
<xsl:choose>
<xsl:when test="japex:resultValue = 'NaN'">
<td class="fail">FAILED</td>
</xsl:when>
<xsl:otherwise>
<td class="pass">PASSED</td>
</xsl:otherwise>
</xsl:choose>
</tr>
</xsl:template>
</xsl:stylesheet>