From e359f7995fcafb2ce18576be6f21345f9f7b1482 Mon Sep 17 00:00:00 2001 From: erik <erik@77661180-640e-0410-b3a8-9f9b13e6d0e0> Date: Wed, 23 Aug 2006 21:31:39 +0000 Subject: [PATCH] --- .../kiss/src/channel-right-now-graphic.xsl | 70 +++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 crawler/kiss/src/channel-right-now-graphic.xsl diff --git a/crawler/kiss/src/channel-right-now-graphic.xsl b/crawler/kiss/src/channel-right-now-graphic.xsl new file mode 100644 index 00000000..43356172 --- /dev/null +++ b/crawler/kiss/src/channel-right-now-graphic.xsl @@ -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, '<br>'), '"]')"/> + </xsl:variable>> + <xsl:if test="string-length($description) > 0 "> + <description> + <xsl:value-of select="$description"/> + </description> + </xsl:if> + + </xsl:template> + +</xsl:stylesheet> -- 2.31.1