(no commit message)
[utils] / crawler / kiss / src / main / resources / channel-right-now.xsl
1 <?xml version="1.0" encoding="UTF-8"?>
2 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3   xmlns:xhtml="http://www.w3.org/1999/xhtml"
4   version="1.0">
5   
6   <xsl:output method="xml"/>
7   <xsl:strip-space elements="xhtml:a"/>
8   
9   <xsl:include href="utilities.xsl"/>
10   
11   <!-- =====================================================
12     Copying template.
13     ===================================================== -->
14   <xsl:template match="@*|node()" mode="copy">
15     <xsl:copy>
16       <xsl:apply-templates select="@*|node()" mode="copy"/>
17     </xsl:copy>
18   </xsl:template>
19   
20   <xsl:template match="/">
21     <xsl:element name="channel-right-now">
22       <xsl:apply-templates select="//xhtml:a"/>
23     </xsl:element>
24   </xsl:template>
25   
26   <xsl:template match="xhtml:a[ count(following::xhtml:a) >= 3]">
27      <xsl:element name="action">
28        <xsl:attribute name="name">
29          <xsl:call-template name="string-replace">
30            <xsl:with-param name="src" select="text()"/>
31            <xsl:with-param name="from" select="$newline"/>
32            <xsl:with-param name="to" select="''"/>
33          </xsl:call-template>
34        </xsl:attribute>
35        <xsl:attribute name="type">
36          <xsl:text>program-info</xsl:text>
37        </xsl:attribute>
38        <xsl:attribute name="reference">
39          <xsl:value-of select="@href"/>
40        </xsl:attribute>
41        <xsl:element name="time">
42          <xsl:value-of select="preceding-sibling::text()[1]"/>
43        </xsl:element>
44      </xsl:element>
45     <xsl:text>
46       
47     </xsl:text>
48   </xsl:template>
49   
50   
51 </xsl:stylesheet>