stylesheets are now searched in the classpath.
[utils] / crawler / kiss / src / channel-overview.xsl
diff --git a/crawler/kiss/src/channel-overview.xsl b/crawler/kiss/src/channel-overview.xsl
new file mode 100644 (file)
index 0000000..59c807b
--- /dev/null
@@ -0,0 +1,74 @@
+<?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-overview">
+      <xsl:apply-templates select="//xhtml:a"/>
+    </xsl:element>
+  </xsl:template>
+  
+  <xsl:template match="xhtml:a">
+     <xsl:variable name="type">
+       <xsl:choose>
+         <xsl:when test="contains(text(), 'Right now')">
+           <xsl:text>right-now</xsl:text>
+         </xsl:when>
+         <xsl:when test="contains(text(), 'Evening')">
+           <xsl:text>evening</xsl:text>
+         </xsl:when>
+         <xsl:when test="contains(text(), 'Afternoon')">
+           <xsl:text>afternoon</xsl:text>
+         </xsl:when>
+         <xsl:when test="contains(text(), 'Noon')">
+           <xsl:text>noon</xsl:text>
+         </xsl:when>
+         <xsl:when test="contains(text(), 'Morning')">
+           <xsl:text>morning</xsl:text>
+         </xsl:when>
+         <xsl:when test="contains(text(), 'Tomorrow')">
+           <xsl:text>tomorrow</xsl:text>
+         </xsl:when>
+         <xsl:otherwise>
+           <xsl:call-template name="string-replace">
+             <xsl:with-param name="src" select="text()"/>
+             <xsl:with-param name="from" select="$newline"/>
+             <xsl:with-param name="to" select="''"/>
+           </xsl:call-template>
+         </xsl:otherwise>
+       </xsl:choose>
+       
+     </xsl:variable>
+     <xsl:element name="action">
+       <xsl:attribute name="name">
+           <xsl:value-of select="$type"/>  
+       </xsl:attribute>
+       <xsl:attribute name="type">
+         <xsl:value-of select="$type"/>
+       </xsl:attribute>
+       <xsl:attribute name="reference">
+         <xsl:value-of select="@href"/>
+       </xsl:attribute>
+       <xsl:text>
+         
+       </xsl:text>
+     </xsl:element>
+  </xsl:template>
+  
+  
+</xsl:stylesheet>