You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by an...@apache.org on 2007/05/10 18:01:45 UTC

svn commit: r536903 - in /lenya/trunk/src/modules/news/xslt: collection2rss.xsl collection2xhtml.xsl shared.xsl

Author: andreas
Date: Thu May 10 09:01:44 2007
New Revision: 536903

URL: http://svn.apache.org/viewvc?view=rev&rev=536903
Log:
Use correct href computation for RSS feed

Added:
    lenya/trunk/src/modules/news/xslt/shared.xsl
Modified:
    lenya/trunk/src/modules/news/xslt/collection2rss.xsl
    lenya/trunk/src/modules/news/xslt/collection2xhtml.xsl

Modified: lenya/trunk/src/modules/news/xslt/collection2rss.xsl
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules/news/xslt/collection2rss.xsl?view=diff&rev=536903&r1=536902&r2=536903
==============================================================================
--- lenya/trunk/src/modules/news/xslt/collection2rss.xsl (original)
+++ lenya/trunk/src/modules/news/xslt/collection2rss.xsl Thu May 10 09:01:44 2007
@@ -30,6 +30,7 @@
     >
     
   <xsl:include href="fallback://lenya/modules/xhtml/xslt/helper-object.xsl"/>
+  <xsl:include href="shared.xsl"/>
   
   <xsl:param name="rendertype" select="''"/>
   <xsl:param name="nodeid"/>
@@ -84,7 +85,10 @@
     <item>
       <title><xsl:value-of select="meta:metadata/dc:elements/dc:title"/></title>
       <description><xsl:value-of select="meta:metadata/dc:elements/dc:description"/></description>
-      <link><xhtml:a href="lenya-document:{@uuid}"/></link>
+      <xsl:variable name="href">
+        <xsl:call-template name="getHref"/>
+      </xsl:variable>
+      <link><xhtml:a href="lenya-document:{$href}"/></link>
       <author><xsl:value-of select="meta:metadata/dc:elements/dc:creator"/></author>
       <xsl:variable name="date" select="meta:metadata/dc:elements/dc:date"/>
       <pubDate><i18n:date-time locale="en" src-pattern="yyyy-MM-dd hh:mm:ss" pattern="EEE, dd MMM yyyy HH:mm:ss Z" value="{$date}" /></pubDate>

Modified: lenya/trunk/src/modules/news/xslt/collection2xhtml.xsl
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules/news/xslt/collection2xhtml.xsl?view=diff&rev=536903&r1=536902&r2=536903
==============================================================================
--- lenya/trunk/src/modules/news/xslt/collection2xhtml.xsl (original)
+++ lenya/trunk/src/modules/news/xslt/collection2xhtml.xsl Thu May 10 09:01:44 2007
@@ -31,6 +31,7 @@
     >
     
   <xsl:include href="fallback://lenya/modules/xhtml/xslt/helper-object.xsl"/>
+  <xsl:include href="shared.xsl"/>
   
   <xsl:param name="rendertype" select="''"/>
   <xsl:param name="nodeid"/>
@@ -70,10 +71,7 @@
         <i18n:date-time src-pattern="yyyy-MM-dd HH:mm:ss" locale="{$language}" value="{$date}" />
       </span><br />
       <xsl:variable name="href">
-        <xsl:choose>
-          <xsl:when test="@uuid">lenya-document:<xsl:value-of select="@uuid"/></xsl:when>
-          <xsl:when test="@href"><xsl:value-of select="@href"/></xsl:when>
-        </xsl:choose>
+        <xsl:call-template name="getHref"/>
       </xsl:variable>
       <a href="{$href}" style="text-decoration: none"><xsl:value-of select="$title"/></a>
     </h2>

Added: lenya/trunk/src/modules/news/xslt/shared.xsl
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules/news/xslt/shared.xsl?view=auto&rev=536903
==============================================================================
--- lenya/trunk/src/modules/news/xslt/shared.xsl (added)
+++ lenya/trunk/src/modules/news/xslt/shared.xsl Thu May 10 09:01:44 2007
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+  
+  <xsl:template name="getHref">
+    <xsl:choose>
+      <xsl:when test="@uuid">lenya-document:<xsl:value-of select="@uuid"/></xsl:when>
+      <xsl:when test="@href"><xsl:value-of select="@href"/></xsl:when>
+    </xsl:choose>
+  </xsl:template>
+
+</xsl:stylesheet>
\ No newline at end of file



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
For additional commands, e-mail: commits-help@lenya.apache.org