- added missing base in two test cases
[libfirm] / ir / be / test / makehtml.xslt
1 <?xml version="1.0"?>
2 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
3         <xsl:output method="html" indent="yes"
4               doctype-public="-//W3C//DTD HTML 4.01//EN"
5                     doctype-system="http://www.w3.org/TR/html4/strict.dtd"/>
6
7         <xsl:template name="resultcell" match="result/*">
8                 <xsl:element name="div">
9                         <xsl:if test="contains(text(), 'ok')">
10                                 <xsl:attribute name="style">background-color: green; color: white;</xsl:attribute>
11                         </xsl:if>
12                         <xsl:if test="contains(text(), 'failed')">
13                                 <xsl:attribute name="style">background-color: red; color: white;</xsl:attribute>
14                         </xsl:if>
15
16                         <xsl:choose>
17                                 <xsl:when test="name() = 'gcc_run'">
18                                         <xsl:element name="a">
19                                                 <xsl:choose>
20                                                         <xsl:when test="contains(text(), 'ok') or contains(text(), 'failed')">
21                                                                 <xsl:attribute name="style">color: white;</xsl:attribute>
22                                                         </xsl:when>
23                                                         <xsl:otherwise>
24                                                                 <xsl:attribute name="style">color: black;</xsl:attribute>
25                                                         </xsl:otherwise>
26                                                 </xsl:choose>
27                                                 <xsl:attribute name="href">result_gcc_<xsl:value-of select="../@name"/>.txt</xsl:attribute>
28                                                 <xsl:value-of select="text()"/>
29                                         </xsl:element>
30                                 </xsl:when>
31                                 <xsl:when test="name() = 'firm_run'">
32                                         <xsl:element name="a">
33                                                 <xsl:choose>
34                                                         <xsl:when test="contains(text(), 'ok') or contains(text(), 'failed')">
35                                                                 <xsl:attribute name="style">color: white;</xsl:attribute>
36                                                         </xsl:when>
37                                                         <xsl:otherwise>
38                                                                 <xsl:attribute name="style">color: black;</xsl:attribute>
39                                                         </xsl:otherwise>
40                                                 </xsl:choose>
41                                                 <xsl:attribute name="href">result_firm_<xsl:value-of select="../@name"/>.txt</xsl:attribute>
42                                                 <xsl:value-of select="text()"/>
43                                         </xsl:element>
44                                 </xsl:when>
45                                 <xsl:when test="name() = 'diff'">
46                                         <xsl:element name="a">
47                                                 <xsl:choose>
48                                                         <xsl:when test="contains(text(), 'ok') or contains(text(), 'failed')">
49                                                                 <xsl:attribute name="style">color: white;</xsl:attribute>
50                                                         </xsl:when>
51                                                         <xsl:otherwise>
52                                                                 <xsl:attribute name="style">color: black;</xsl:attribute>
53                                                         </xsl:otherwise>
54                                                 </xsl:choose>
55                                                 <xsl:attribute name="href">result_diff_<xsl:value-of select="../@name"/>.txt</xsl:attribute>
56                                                 <xsl:value-of select="text()"/>
57                                         </xsl:element>
58                                 </xsl:when>
59                                 <xsl:otherwise>
60                                         <xsl:value-of select="text()"/>
61                                 </xsl:otherwise>
62                         </xsl:choose>
63                 </xsl:element>
64         </xsl:template>
65
66         <xsl:template match="/">
67                 <html>
68                         <head>
69                                 <title>Results</title>
70                         </head>
71                         <body>
72                                 <table>
73                                         <tr>
74                                                 <th>Name</th>
75                                                 <th>Compile</th>
76                                                 <th>Link</th>
77                                                 <th>GCC Compile</th>
78                                                 <th>GCC Run</th>
79                                                 <th>Firm Run</th>
80                                                 <th>Results</th>
81                                         </tr>
82                                         <xsl:for-each select="/results/result">
83                                                 <tr>
84                                                         <td>
85                                                                 <xsl:element name="a">
86                                                                         <xsl:attribute name="href">buildresult_<xsl:value-of select="@name"/>.txt</xsl:attribute>
87                                                                         <xsl:value-of select="@name"/>
88                                                                 </xsl:element>
89                                                         </td>
90                                                         <td><xsl:apply-templates select="compile"/></td>
91                                                         <td><xsl:apply-templates select="link"/></td>
92                                                         <td><xsl:apply-templates select="gcc_compile"/></td>
93                                                         <td><xsl:apply-templates select="gcc_run"/></td>
94                                                         <td><xsl:apply-templates select="firm_run"/></td>
95                                                         <td><xsl:apply-templates select="diff"/></td>
96                                                 </tr>
97                                         </xsl:for-each>
98                                 </table>
99                         </body>
100                 </html>
101         </xsl:template>
102 </xsl:stylesheet>