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"
6 <xsl:output method="xml"/>
7 <xsl:strip-space elements="xhtml:a"/>
9 <xsl:include href="utilities.xsl"/>
11 <!-- =====================================================
13 ===================================================== -->
14 <xsl:template match="@*|node()" mode="copy">
16 <xsl:apply-templates select="@*|node()" mode="copy"/>
20 <xsl:template match="/">
21 <xsl:element name="channel-overview">
22 <xsl:apply-templates select="//xhtml:a"/>
26 <xsl:template match="xhtml:a">
27 <xsl:variable name="type">
29 <xsl:when test="contains(text(), 'Right now')">
30 <xsl:text>right-now</xsl:text>
32 <xsl:when test="contains(text(), 'Evening')">
33 <xsl:text>evening</xsl:text>
35 <xsl:when test="contains(text(), 'Afternoon')">
36 <xsl:text>afternoon</xsl:text>
38 <xsl:when test="contains(text(), 'Noon')">
39 <xsl:text>noon</xsl:text>
41 <xsl:when test="contains(text(), 'Morning')">
42 <xsl:text>morning</xsl:text>
44 <xsl:when test="contains(text(), 'Tomorrow')">
45 <xsl:text>tomorrow</xsl:text>
48 <xsl:call-template name="string-replace">
49 <xsl:with-param name="src" select="text()"/>
50 <xsl:with-param name="from" select="$newline"/>
51 <xsl:with-param name="to" select="''"/>
57 <xsl:element name="action">
58 <xsl:attribute name="name">
59 <xsl:value-of select="$type"/>
61 <xsl:attribute name="type">
62 <xsl:value-of select="$type"/>
64 <xsl:attribute name="reference">
65 <xsl:value-of select="@href"/>