forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From je...@apache.org
Subject cvs commit: xml-forrest/src/resources/stylesheets directory2book.xsl
Date Wed, 08 Oct 2003 10:53:45 GMT
jefft       2003/10/08 03:53:45

  Modified:    src/resources/stylesheets directory2book.xsl
  Log:
  Allow the href to be overridden.  Thanks to Eric BURGHARD
  
  Revision  Changes    Path
  1.11      +13 -18    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.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- directory2book.xsl	6 Oct 2003 06:32:48 -0000	1.10
  +++ directory2book.xsl	8 Oct 2003 10:53:45 -0000	1.11
  @@ -50,7 +50,7 @@
       <xsl:param name="sort-order" select="'ascending'"/>
       <xsl:param name="sort-case-order" select="'upper-first'"/>
       <xsl:param name="sort-select" select="'.'"/>
  -            
  +
       <xsl:template match="/">
           <book copyright="" software="" title="">
               <!--
  @@ -64,8 +64,8 @@
   
       <xsl:template match="dir:directory">
           <menu label="{translate(@name,'-_',' ')}">
  -           <xsl:apply-templates select="dir:file">
  -                <xsl:sort order="{$sort-order}"  case-order="{$sort-case-order}" select="dyn:evaluate($sort-select)"/>
  +            <xsl:apply-templates select="dir:file">
  +                <xsl:sort case-order="{$sort-case-order}" order="{$sort-order}" select="dyn:evaluate($sort-select)"/>
               </xsl:apply-templates>
           </menu>
           <xsl:apply-templates select="dir:directory [descendant::dir:file]"/>
  @@ -93,28 +93,23 @@
                           <xsl:variable name="path" select="concat($path, @name, '/')"/>
                           <xsl:value-of select="$path"/>
                       </xsl:for-each>
  -                    <xsl:value-of select="concat($corename, '.', $served-extension)"/>
  +                    <!-- indirection to allow get-href overriding -->
  +                    <xsl:call-template name="get-href">
  +                        <xsl:with-param name="corename" select="$corename"/>
  +                    </xsl:call-template>
                   </xsl:attribute>
               </menu-item>
           </xsl:if>
       </xsl:template>
   
  -    <!-- label is  short-title, title and in last resort filename
  -         override this to your needs -->
  +    <!-- override this to your needs. For example, see xpathdirectory2book.xsl -->
       <xsl:template name="get-label">
           <xsl:param name="corename"/>
  -        <xsl:choose>
  -            <xsl:when test="dir:xpath/meta[@name='short-title']">
  -                <xsl:value-of select="dir:xpath/meta[@name='short-title']"/>
  -            </xsl:when>
  -            <xsl:when test="dir:xpath/title">
  -                <xsl:value-of select="dir:xpath/title"/>
  -            </xsl:when>
  -            <xsl:otherwise>
  -                <xsl:value-of select="$corename"/>
  -            </xsl:otherwise>
  -        </xsl:choose>
  +        <xsl:value-of select="translate($corename,'-_',' ')"/>
       </xsl:template>
   
  -    
  +    <xsl:template name="get-href">
  +        <xsl:param name="corename"/>
  +        <xsl:value-of select="concat($corename, '.', $served-extension)"/>
  +    </xsl:template>
   </xsl:stylesheet>
  
  
  

Mime
View raw message