1 <?xml version="1.0" encoding="UTF-8"?>
2 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
3 <xsl:output method="text"/>
5 <xsl:include href="utilities.xsl"/>
6 <xsl:template match="report">
7 <xsl:text>KiSS crawler report</xsl:text>
8 <xsl:value-of select="$newline"/>
9 <xsl:value-of select="$newline"/>
11 <xsl:apply-templates select="recorded"/>
12 <xsl:if test="count(interesting) > 0">
13 <xsl:text>Possibly interesting programs</xsl:text>
14 <xsl:value-of select="$newline"/>
15 <xsl:value-of select="$newline"/>
17 <xsl:apply-templates select="interesting"/>
20 <xsl:apply-templates select="messages"/>
23 <xsl:template name="programTable">
24 <xsl:apply-templates select="program"/>
26 <xsl:template match="recorded">
28 <xsl:when test="@result = 'OK'">
29 <xsl:text>Successfully recorded programs </xsl:text>
30 <xsl:value-of select="$newline"/>
31 <xsl:value-of select="$newline"/>
32 <xsl:call-template name="programTable"/>
34 <xsl:when test="@result = 'DUPLICATE'">
35 <xsl:text>Already recorded programs</xsl:text>
36 <xsl:value-of select="$newline"/>
37 <xsl:value-of select="$newline"/>
38 <xsl:call-template name="programTable"/>
40 <xsl:when test="@result = 'CONFLICT'">
41 <xsl:text>Conflicts with other recorded programs</xsl:text>
42 <xsl:value-of select="$newline"/>
43 <xsl:value-of select="$newline"/>
44 <xsl:call-template name="programTable"/>
46 <xsl:when test="@result='ERROR'">
47 <xsl:text>Programs that could not be recorded for technical reasons.</xsl:text>
48 <xsl:value-of select="$newline"/>
49 <xsl:value-of select="$newline"/>
50 <xsl:call-template name="programTable"/>
56 <xsl:template name="addProgramInfo">
57 <xsl:text>*</xsl:text>
58 <xsl:value-of select="interval/begin"/> - <xsl:value-of select="interval/end"/>
59 <xsl:text>: </xsl:text>
60 <xsl:value-of select="name"/>
61 <xsl:text>(</xsl:text>
62 <xsl:value-of select="channel"/>
63 <xsl:text>/</xsl:text><xsl:value-of select="keywords"/>
64 <xsl:text>)</xsl:text>
65 <xsl:value-of select="$newline"/>
66 <xsl:variable name="indent">
67 <xsl:text> </xsl:text>
69 <xsl:call-template name="indent">
70 <xsl:with-param name="src">
71 <xsl:call-template name="word-wrap">
72 <xsl:with-param name="src"><xsl:value-of select="description"/></xsl:with-param>
73 <xsl:with-param name="width"><xsl:value-of select="72"/></xsl:with-param>
76 <xsl:with-param name="indentString">
77 <xsl:text> </xsl:text>
83 <xsl:value-of select="$indent"/>
84 <xsl:call-template name="string-replace">
85 <xsl:with-param name="src"><xsl:value-of select="description"/></xsl:with-param>
86 <xsl:with-param name="from"><xsl:value-of select="$newline"/></xsl:with-param>
87 <xsl:with-param name="to"><xsl:value-of select="$newline"/><xsl:value-of select="$indent"/></xsl:with-param>
90 <xsl:value-of select="$newline"/>
91 <xsl:value-of select="$newline"/>
94 <xsl:template match="program">
95 <xsl:call-template name="addProgramInfo"/>
98 <xsl:template match="interesting">
99 <xsl:call-template name="programTable"/>
100 <xsl:apply-templates select="category"/>
103 <xsl:template match="category">
104 <xsl:text>Category: </xsl:text><xsl:value-of select="@name"/>
105 <xsl:value-of select="$newline"/>
106 <xsl:value-of select="$newline"/>
107 <xsl:call-template name="programTable"/>
110 <xsl:template match="messages">
111 <xsl:text>Messages</xsl:text>
112 <xsl:value-of select="$newline"/>
113 <xsl:value-of select="$newline"/>
114 <xsl:for-each select="message">
115 <xsl:text>* </xsl:text>
116 <xsl:value-of select="."/>
117 <xsl:value-of select="$newline"/>