54e5e2d1fdbd8c062bbd402236dca06d7cf3da27
[libfirm] / ir / be / test / makediffhtml.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                         <xsl:if test="contains(text(), 'missing')">
16                                 <xsl:attribute name="style">background-color: black; color: white;</xsl:attribute>
17                         </xsl:if>
18                         <xsl:value-of select="text()"/>
19                 </xsl:element>
20         </xsl:template>
21
22         <xsl:template match="/">
23                 <html>
24                         <head>
25                                 <title>Results</title>
26                         </head>
27                         <body>
28                                 OLD: <xsl:value-of select="/results/files/OLD"/><br/>
29                                 NEW: <xsl:value-of select="/results/files/NEW"/><br/><br/>
30                                 <table>
31                                         <tr>
32                                                 <th>Name</th>
33                                                 <th>Compile</th>
34                                                 <th>Link</th>
35                                                 <th>GCC Compile</th>
36                                                 <th>GCC Run</th>
37                                                 <th>Firm Run</th>
38                                                 <th>Results</th>
39                                         </tr>
40                                         <xsl:for-each select="/results/section">
41                                                 <tr>
42                                                     <th colspan="7" style="background-color: yellow; color: black;"><xsl:value-of select="@name"/></th>
43                                                 </tr>
44                                                 <xsl:for-each select="result">
45                                                         <tr>
46                                                                 <th rowspan="2">
47                                                                         <xsl:element name="a">
48                                                                                 <xsl:attribute name="href">buildresult_<xsl:value-of select="@name"/>.txt</xsl:attribute>
49                                                                                 <xsl:value-of select="@name"/>
50                                                                         </xsl:element>
51                                                                 </th>
52                                                                 <td><xsl:apply-templates select="OLD/compile"/></td>
53                                                                 <td><xsl:apply-templates select="OLD/link"/></td>
54                                                                 <td><xsl:apply-templates select="OLD/gcc_compile"/></td>
55                                                                 <td><xsl:apply-templates select="OLD/gcc_run"/></td>
56                                                                 <td><xsl:apply-templates select="OLD/firm_run"/></td>
57                                                                 <td><xsl:apply-templates select="OLD/diff"/></td>
58                                                         </tr>
59                                                         <tr>
60                                                                 <td><xsl:apply-templates select="NEW/compile"/></td>
61                                                                 <td><xsl:apply-templates select="NEW/link"/></td>
62                                                                 <td><xsl:apply-templates select="NEW/gcc_compile"/></td>
63                                                                 <td><xsl:apply-templates select="NEW/gcc_run"/></td>
64                                                                 <td><xsl:apply-templates select="NEW/firm_run"/></td>
65                                                                 <td><xsl:apply-templates select="NEW/diff"/></td>
66                                                         </tr>
67                                                         <tr>
68                                                             <th colspan="7"> </th>
69                                                         </tr>
70                                                 </xsl:for-each>
71                                         </xsl:for-each>
72                                 </table>
73                         </body>
74                 </html>
75         </xsl:template>
76 </xsl:stylesheet>