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"/>
21 <xsl:template name="programTable">
22 <xsl:apply-templates select="program"/>
24 <xsl:template match="recorded">
26 <xsl:when test="@result = 'OK'">
27 <xsl:text>Successfully recorded programs </xsl:text>
28 <xsl:value-of select="$newline"/>
29 <xsl:value-of select="$newline"/>
30 <xsl:call-template name="programTable"/>
32 <xsl:when test="@result = 'DUPLICATE'">
33 <xsl:text>Already recorded programs</xsl:text>
34 <xsl:value-of select="$newline"/>
35 <xsl:value-of select="$newline"/>
36 <xsl:call-template name="programTable"/>
38 <xsl:when test="@result = 'CONFLICT'">
39 <xsl:text>Conflicts with other recorded programs</xsl:text>
40 <xsl:value-of select="$newline"/>
41 <xsl:value-of select="$newline"/>
42 <xsl:call-template name="programTable"/>
44 <xsl:when test="@result='ERROR'">
45 <xsl:text>Programs that could not be recorded for technical reasons.</xsl:text>
46 <xsl:value-of select="$newline"/>
47 <xsl:value-of select="$newline"/>
48 <xsl:call-template name="programTable"/>
54 <xsl:template name="addProgramInfo">
55 <xsl:text>*</xsl:text>
56 <xsl:value-of select="interval/begin"/> - <xsl:value-of select="interval/end"/>
57 <xsl:text>: </xsl:text>
58 <xsl:value-of select="name"/>
59 <xsl:text>(</xsl:text>
60 <xsl:value-of select="channel"/>
61 <xsl:text>/</xsl:text><xsl:value-of select="keywords"/>
62 <xsl:text>)</xsl:text>
63 <xsl:value-of select="$newline"/>
64 <xsl:variable name="indent">
65 <xsl:text> </xsl:text>
67 <xsl:call-template name="indent">
68 <xsl:with-param name="src">
69 <xsl:call-template name="word-wrap">
70 <xsl:with-param name="src"><xsl:value-of select="description"/></xsl:with-param>
71 <xsl:with-param name="width"><xsl:value-of select="72"/></xsl:with-param>
74 <xsl:with-param name="indentString">
75 <xsl:text> </xsl:text>
81 <xsl:value-of select="$indent"/>
82 <xsl:call-template name="string-replace">
83 <xsl:with-param name="src"><xsl:value-of select="description"/></xsl:with-param>
84 <xsl:with-param name="from"><xsl:value-of select="$newline"/></xsl:with-param>
85 <xsl:with-param name="to"><xsl:value-of select="$newline"/><xsl:value-of select="$indent"/></xsl:with-param>
88 <xsl:value-of select="$newline"/>
89 <xsl:value-of select="$newline"/>
92 <xsl:template match="program">
93 <xsl:call-template name="addProgramInfo"/>
96 <xsl:template match="interesting">
97 <xsl:call-template name="programTable"/>
98 <xsl:apply-templates select="category"/>
101 <xsl:template match="category">
102 <xsl:text>Category: </xsl:text><xsl:value-of select="@name"/>
103 <xsl:value-of select="$newline"/>
104 <xsl:value-of select="$newline"/>
105 <xsl:call-template name="programTable"/>