(no commit message)
authorerik <erik@77661180-640e-0410-b3a8-9f9b13e6d0e0>
Wed, 23 Aug 2006 21:31:39 +0000 (21:31 +0000)
committererik <erik@77661180-640e-0410-b3a8-9f9b13e6d0e0>
Wed, 23 Aug 2006 21:31:39 +0000 (21:31 +0000)
crawler/kiss/src/channel-right-now-graphic.xsl [new file with mode: 0644]

diff --git a/crawler/kiss/src/channel-right-now-graphic.xsl b/crawler/kiss/src/channel-right-now-graphic.xsl
new file mode 100644 (file)
index 0000000..4335617
--- /dev/null
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns:xhtml="http://www.w3.org/1999/xhtml"
+  version="1.0">
+  
+  <xsl:output method="xml"/>
+  <xsl:strip-space elements="xhtml:a"/>
+  
+  <xsl:include href="utilities.xsl"/>
+  
+  <!-- =====================================================
+    Copying template.
+    ===================================================== -->
+  <xsl:template match="@*|node()" mode="copy">
+    <xsl:copy>
+      <xsl:apply-templates select="@*|node()" mode="copy"/>
+    </xsl:copy>
+  </xsl:template>
+  
+  <xsl:template match="/">
+    <xsl:element name="channel-right-now">
+      <xsl:apply-templates select="//xhtml:table[3]//xhtml:tr[xhtml:td[not(contains(@class, 'listCell'))]]"/>
+    </xsl:element>
+  </xsl:template>
+  
+  <xsl:template match="xhtml:tr">
+     <xsl:element name="action">
+       <xsl:attribute name="name">
+         <xsl:call-template name="string-replace">
+           <xsl:with-param name="src" select="xhtml:td[3]//xhtml:a"/>
+           <xsl:with-param name="from" select="$newline"/>
+           <xsl:with-param name="to" select="''"/>
+         </xsl:call-template>
+       </xsl:attribute>
+       <xsl:attribute name="type">
+         <xsl:text>program-info</xsl:text>
+       </xsl:attribute>
+       <xsl:attribute name="reference">
+         <xsl:value-of select="xhtml:td[3]//xhtml:a/@href"/>
+       </xsl:attribute>
+       <xsl:element name="time">
+         <xsl:call-template name="string-replace">
+           <xsl:with-param name="src" select="xhtml:td[1]"/>
+           <xsl:with-param name="from" select="$newline"/>
+           <xsl:with-param name="to" select="''"/>
+         </xsl:call-template>
+       </xsl:element>
+       <xsl:apply-templates select=".//xhtml:script"/>
+     </xsl:element>
+    <xsl:text>
+      
+    </xsl:text>
+  </xsl:template>
+  
+  <xsl:template match="xhtml:script">
+    <xsl:variable name="script">
+      <xsl:value-of select="."/>   
+    </xsl:variable>
+    <xsl:variable name="description">
+      <xsl:value-of select="substring-before(substring-after($script, '&lt;br&gt;'), '&quot;]')"/> 
+    </xsl:variable>>
+    <xsl:if test="string-length($description) > 0 ">
+      <description>
+        <xsl:value-of select="$description"/>
+      </description>
+    </xsl:if>
+     
+  </xsl:template>
+  
+</xsl:stylesheet>