ec0f9797b3635c7a92b7d0757367677b0fa87dec
[utils] / crawler / kiss / src / main / resources / program-info.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="program-info">
22       <xsl:apply-templates select="//xhtml:a"/>
23       <xsl:element name="title">
24         <xsl:value-of select="//xhtml:h2[1]"/>
25       </xsl:element>
26       <xsl:element name="keywords">
27         <xsl:apply-templates select="//text()[count(preceding::xhtml:br)= 1]"/>
28       </xsl:element>
29       <xsl:element name="description">
30         <xsl:apply-templates select="//text()[count(preceding::xhtml:h2) = 2 and
31           count(following::xhtml:br) >= 4 and count(preceding::xhtml:br) >= 3]"/>
32       </xsl:element>
33     </xsl:element>
34   </xsl:template>
35   
36   
37   
38   <xsl:template match="xhtml:a[ text() = 'Record' ]">
39      <xsl:element name="action">
40        <xsl:attribute name="name">
41          <xsl:text>record</xsl:text>
42        </xsl:attribute>
43        <xsl:attribute name="reference">
44          <xsl:value-of select="@href"/>
45        </xsl:attribute>
46        <xsl:attribute name="type">
47          <xsl:text>recorded</xsl:text>
48        </xsl:attribute>
49        <xsl:text>
50          
51        </xsl:text>
52      </xsl:element>
53   </xsl:template>
54   
55   
56 </xsl:stylesheet>