<?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">
-
+ 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: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: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: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:value-of select="."/>
</xsl:variable>
<xsl:variable name="description">
- <xsl:value-of select="substring-before(substring-after($script, '<br>'), '"]')"/>
- </xsl:variable>>
- <xsl:if test="string-length($description) > 0 ">
- <description>
- <xsl:value-of select="$description"/>
- </description>
- </xsl:if>
-
+ <xsl:value-of
+ select="substring-before(substring-after($script, '<br>'), '"]')"/>
+ </xsl:variable>
+ <description>
+ <xsl:value-of select="$description"/>
+ </description>
+
</xsl:template>
-
+
</xsl:stylesheet>