f3901ea3c1ce3d6d465e657ae4f6d10acd891de9
[utils] / crawler / kiss / conf / kiss / 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='ERROR'">
48                     <xsl:text>Programs that could not be recorded for
49                     technical reasons.</xsl:text>
50                 </xsl:when>
51             </xsl:choose>
52         </h2>
53         <p>
54             <xsl:call-template name="programTable"/>
55         </p>
56     </xsl:template>
57
58     <xsl:template name="addProgramInfo">
59         <tr align="left">
60             <td><xsl:value-of select="interval/begin"/> - <xsl:value-of select="interval/end"/>: <strong>
61                     <xsl:value-of select="name"/>
62                 </strong> (<xsl:value-of select="channel"/>/<xsl:value-of select="keywords"/>)</td>
63
64         </tr>
65         <tr>
66             <td>
67                 <blockquote>
68                         <font size="-1">
69                             <xsl:value-of select="description"/>
70                         </font>
71                 </blockquote>
72             </td>
73
74
75         </tr>
76     </xsl:template>
77
78     <xsl:template match="program">
79         <xsl:call-template name="addProgramInfo"/>
80     </xsl:template>
81
82     <xsl:template match="interesting">
83         <xsl:call-template name="programTable"/>
84         <xsl:apply-templates select="category"/>
85     </xsl:template>
86
87     <xsl:template match="category">
88         <h3>Category: <xsl:value-of select="@name"/></h3>
89         <xsl:call-template name="programTable"/>
90     </xsl:template>
91 </xsl:stylesheet>
92