forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cross...@apache.org
Subject cvs commit: xml-forrest/src/resources/stylesheets directory2book.xsl
Date Fri, 04 Jul 2003 14:40:26 GMT
crossley    2003/07/04 07:40:26

  Modified:    src/resources/stylesheets directory2book.xsl
  Log:
  Handle menu-items in multiple levels of sub-directories.
  Submitted by: Juan Jose Pablos cheche<AT>che-che.com
  
  Revision  Changes    Path
  1.3       +11 -2     xml-forrest/src/resources/stylesheets/directory2book.xsl
  
  Index: directory2book.xsl
  ===================================================================
  RCS file: /home/cvs/xml-forrest/src/resources/stylesheets/directory2book.xsl,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- directory2book.xsl	16 Jun 2003 11:19:53 -0000	1.2
  +++ directory2book.xsl	4 Jul 2003 14:40:26 -0000	1.3
  @@ -53,8 +53,17 @@
     </xsl:template>
   
     <xsl:template match="dir:file[not(@name=concat('book', $ext))]">
  -    <menu-item label="{substring-before(@name, $ext)}"
  -    href="{concat(substring-before(@name, $ext), '.html')}"/>
  +    <menu-item label="{substring-before(@name, $ext)}">
  +      <xsl:attribute name="href">
  +      <xsl:variable name="path" />
  +        <!-- [not (position()=last())] is to ignore the root node -->
  +        <xsl:for-each select="ancestor::dir:directory [not (position()=last())]">
  +          <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:attribute>
  +    </menu-item>
     </xsl:template>
   
   </xsl:stylesheet>
  
  
  

Mime
View raw message