forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric BURGHARD <eburg...@free.fr>
Subject [PATCH] directory2book.xsl
Date Tue, 30 Sep 2003 10:24:29 GMT
Hi,

directory2book.xsl always generate .html links.
i've patched directory2book.xsl to be able to serve raw documents from the 
side menu (eg. pdf)

--- src/resources/stylesheets/directory2book.xsl        30 Jul 2003 08:37:54 
-0000      1.7
+++ src/resources/stylesheets/directory2book.xsl        30 Sep 2003 10:18:52 
-0000
@@ -31,8 +31,10 @@
   <xsl:output doctype-system="book-cocoon-v10.dtd" 
doctype-public="-//APACHE//DTD Cocoon Documentation Book V1.0//EN"/>

   <xsl:param name="expected-extension" select="'xml'"/>
-
+  <xsl:param name="served-extension" select="html"/>
+
   <xsl:variable name="ext" select="concat('.', $expected-extension)"/>
+  <xsl:variable name="sext" select="concat('.', $served-extension)"/>

   <xsl:template match="/">
     <book software="" title="" copyright="">
@@ -62,7 +64,7 @@
           <xsl:variable name="path" select="concat($path, @name, '/')" />
           <xsl:value-of select="$path"/>
         </xsl:for-each>
-        <xsl:value-of select="concat(substring-before(@name, $ext), 
'.html')"/>
+        <xsl:value-of select="concat(substring-before(@name, $ext), $sext)"/>
       </xsl:attribute>
     </menu-item>
   </xsl:template>


Mime
View raw message