word-wrapping is now ok.
authorErik Brakkee <erik@brakkee.org>
Sun, 26 Mar 2006 11:59:55 +0000 (11:59 +0000)
committerErik Brakkee <erik@brakkee.org>
Sun, 26 Mar 2006 11:59:55 +0000 (11:59 +0000)
crawler/kiss/conf/kiss/programs.xml
crawler/kiss/src/utilities.xsl

index a248c21caa538c68f9102d3d47146187048d428a..c2d26f4fc0c5b040ebba68859e7d0fc450d778e4 100644 (file)
     <action>notify</action>
     <match field="description">horror</match>
   </program>
+
+  <program>
+    <category>horror</category>
+    <action>notify</action>
+    <match>the.*ghost.*whisperer</match>
+  </program>
   
   <program>
     <category>films</category>
@@ -54,7 +60,7 @@
   </program>
   
   <program>
-    <priority>10</priority>
+    <priority>11</priority>
     <match>battlestar</match>
   </program>
 
     <priority>10</priority>
     <match>star trek</match>
   </program>
-  
+
   <program>
     <priority>9</priority>
+    <match>buffy.*vampire.*slayer</match>
+  </program>
+  
+  <program>
+    <priority>8</priority>
     <match>lois.*clark</match>
   </program>
   
index e6863db215bbe0e0842b3078edad149fd48ba1c1..0dd7e62b3d6e0f016f4ef9e80fe59bf7d955ac11 100644 (file)
@@ -3,16 +3,16 @@
 <!-- Note the declaration of the namespace for XInclude. -->
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
   xmlns:xi="http://www.w3.org/2001/XInclude">
-  
-  
+
+
   <xsl:variable name="newline">
     <xsl:text>&#10;</xsl:text>
   </xsl:variable>
-  
+
   <xsl:variable name="carriageReturn">
     <xsl:text>&#13;&#10;</xsl:text>
   </xsl:variable>
-  
+
   <!-- =====================================================
     Replace one string by another
     - src: string to do substituion in
       </xsl:otherwise>
     </xsl:choose>
   </xsl:template>
-  
+
   <xsl:template name="indent">
     <xsl:param name="src"/>
     <xsl:param name="indentString"/>
     <xsl:value-of select="$indentString"/>
     <xsl:call-template name="string-replace">
-      <xsl:with-param name="src"><xsl:value-of select="$src"/></xsl:with-param>
-      <xsl:with-param name="from"><xsl:value-of select="$newline"/></xsl:with-param>
+      <xsl:with-param name="src">
+        <xsl:value-of select="$src"/>
+      </xsl:with-param>
+      <xsl:with-param name="from">
+        <xsl:value-of select="$newline"/>
+      </xsl:with-param>
       <xsl:with-param name="to">
         <xsl:value-of select="$newline"/>
         <xsl:value-of select="$indentString"/>
       </xsl:with-param>
     </xsl:call-template>
   </xsl:template>
-  
+
   <xsl:template name="word-wrap">
     <xsl:param name="src"/>
     <xsl:param name="width"/>
-    
+
     <xsl:call-template name="word-wrap-impl">
       <xsl:with-param name="src">
         <xsl:call-template name="string-replace">
           <xsl:with-param name="src">
-            <xsl:value-of select="$src"/>     
+            <xsl:value-of select="$src"/>
+          </xsl:with-param>
+          <xsl:with-param name="from">
+            <xsl:text>  </xsl:text>
+          </xsl:with-param>
+          <xsl:with-param name="to">
+            <xsl:text> </xsl:text>
           </xsl:with-param>
-          <xsl:with-param name="from"><xsl:text>  </xsl:text></xsl:with-param>
-          <xsl:with-param name="to"><xsl:text> </xsl:text></xsl:with-param>
         </xsl:call-template>
       </xsl:with-param>
-      <xsl:with-param name="width"><xsl:value-of select="$width"/></xsl:with-param>
-      <xsl:with-param name="index"><xsl:value-of select="0"/></xsl:with-param>
+      <xsl:with-param name="width">
+        <xsl:value-of select="$width"/>
+      </xsl:with-param>
+      <xsl:with-param name="index">
+        <xsl:value-of select="0"/>
+      </xsl:with-param>
     </xsl:call-template>
   </xsl:template>
-  
+
   <xsl:template name="word-wrap-impl">
     <xsl:param name="src"/>
     <xsl:param name="index"/>
     <xsl:param name="width"/>
-    
+
     <xsl:variable name="word">
-      <xsl:value-of select="substring-before($src, ' ')"></xsl:value-of>
+      <xsl:value-of select="substring-before($src, ' ')"/>
     </xsl:variable>
     <xsl:variable name="wordlength">
       <xsl:value-of select="string-length($word)"/>
     <xsl:variable name="remainder">
       <xsl:value-of select="substring($src, $wordlength+2)"/>
     </xsl:variable>
-    
-    <xsl:value-of select="$word"/><xsl:text> </xsl:text>
-    
-    <xsl:if test="string-length($remainder) > 0">
-      
-      <!-- xsl:value-of select="$index"/ -->
-      <xsl:choose>
-        <xsl:when test="$index + $wordlength + 1 &gt; $width">
-          <xsl:value-of select="$newline"/>
+
+    <xsl:choose>
+      <xsl:when test="$index + $wordlength + 1 &gt; $width">
+        <xsl:value-of select="$newline"/>
+        <xsl:value-of select="$word"/>
+        <xsl:text> </xsl:text>
+        <xsl:if test="string-length($remainder) > 0">
           <xsl:call-template name="word-wrap-impl">
-            <xsl:with-param name="src"><xsl:value-of select="$remainder"></xsl:value-of></xsl:with-param>
-            <xsl:with-param name="index"><xsl:value-of select="0"/></xsl:with-param>
-            <xsl:with-param name="width"><xsl:value-of select="$width"></xsl:value-of></xsl:with-param>
+            <xsl:with-param name="src">
+              <xsl:value-of select="$remainder"/>
+            </xsl:with-param>
+            <xsl:with-param name="index">
+              <xsl:value-of select="$wordlength + 1"/>
+            </xsl:with-param>
+            <xsl:with-param name="width">
+              <xsl:value-of select="$width"/>
+            </xsl:with-param>
           </xsl:call-template>
-        </xsl:when>
-        <xsl:otherwise>
+        </xsl:if>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="$word"/>
+        <xsl:text> </xsl:text>
+
+        <xsl:if test="string-length($remainder) > 0">
           <xsl:call-template name="word-wrap-impl">
-            <xsl:with-param name="src"><xsl:value-of select="$remainder"></xsl:value-of></xsl:with-param>
-            <xsl:with-param name="index"><xsl:value-of select="$index + $wordlength+1"/></xsl:with-param>
-            <xsl:with-param name="width"><xsl:value-of select="$width"></xsl:value-of></xsl:with-param>
+            <xsl:with-param name="src">
+              <xsl:value-of select="$remainder"/>
+            </xsl:with-param>
+            <xsl:with-param name="index">
+              <xsl:value-of select="$index + $wordlength+1"/>
+            </xsl:with-param>
+            <xsl:with-param name="width">
+              <xsl:value-of select="$width"/>
+            </xsl:with-param>
           </xsl:call-template>
-        </xsl:otherwise>
-      </xsl:choose>
-     
-      
-    </xsl:if>
+        </xsl:if>
+      </xsl:otherwise>
+    </xsl:choose>
   </xsl:template>
-  
+
 </xsl:stylesheet>