(no commit message)
[utils] / crawler / kiss / src / reportToHtml.xsl
1 <?xml version="1.0" encoding="UTF-8"?>
2 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
3
4     <xsl:template match="report">
5         <html>
6             <head>
7                 <title>KiSS crawler report</title>
8             </head>
9             <body>
10                 <h1>KiSS crawler report</h1>
11                 <xsl:apply-templates select="recorded"/>
12                 <xsl:if test="count(interesting) > 0">
13                     <h2>Possibly interesting programs</h2>
14                     <xsl:apply-templates select="interesting"/>
15                 </xsl:if>
16                 <xsl:if test="count(//program) = 0">
17                     <xsl:text>No suitable programs found </xsl:text>
18                 </xsl:if>
19             </body>
20         </html>
21
22     </xsl:template>
23
24     <xsl:template name="programTable">
25         <table align="left" cellpadding="5">
26             <!-- 
27             <tr align="left">
28                 <th align="left">Time</th>
29                 <th align="left">Channel</th>
30                 <th align="left">Program</th>
31             </tr>
32             -->
33             <xsl:apply-templates select="program"/>
34         </table>
35         <br clear="left"/>
36     </xsl:template>
37
38     <xsl:template match="recorded">
39         <h2>
40             <xsl:choose>
41                 <xsl:when test="@result = 'OK'">
42                     <xsl:text>Successfully recorded programs </xsl:text>
43                 </xsl:when>
44                 <xsl:when test="@result = 'DUPLICATE'">
45                     <xsl:text>Already recorded programs</xsl:text>
46                 </xsl:when>
47                 <xsl:when test="@result = 'CONFLICT'">
48                     <xsl:text>Conflicts with other recorded programs</xsl:text>
49                 </xsl:when>
50                 <xsl:when test="@result='ERROR'">
51                     <xsl:text>Programs that could not be recorded for
52                     technical reasons.</xsl:text>
53                 </xsl:when>
54             </xsl:choose>
55         </h2>
56         <p>
57             <xsl:if test="not(@result='OLDSHOW')">
58                 <xsl:call-template name="programTable"/>
59             </xsl:if>
60         </p>
61     </xsl:template>
62
63     <xsl:template name="addProgramInfo">
64         <tr align="left">
65             <td><xsl:value-of select="interval/begin"/> - <xsl:value-of select="interval/end"/>: <strong>
66                     <xsl:value-of select="name"/>
67                 </strong> (<xsl:value-of select="channel"/>/<xsl:value-of select="keywords"/>)</td>
68
69         </tr>
70         <tr>
71             <td>
72                 <blockquote>
73                         <font size="-1">
74                             <xsl:value-of select="description"/>
75                         </font>
76                 </blockquote>
77             </td>
78
79
80         </tr>
81     </xsl:template>
82
83     <xsl:template match="program">
84         <xsl:call-template name="addProgramInfo"/>
85     </xsl:template>
86
87     <xsl:template match="interesting">
88         <xsl:call-template name="programTable"/>
89         <xsl:apply-templates select="category"/>
90     </xsl:template>
91
92     <xsl:template match="category">
93         <h3>Category: <xsl:value-of select="@name"/></h3>
94         <xsl:call-template name="programTable"/>
95     </xsl:template>
96 </xsl:stylesheet>
97