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/skins/common/xslt/html book2menu.xsl tab2menu.xsl
Date Sun, 17 Nov 2002 00:00:02 GMT
jefft       2002/11/16 16:00:02

  Modified:    src/resources/skins/common/xslt/html book2menu.xsl
                        tab2menu.xsl
  Log:
  Some rearranging and classification of templates into SHOULD, CAN and SHOULD
  NOT override
  
  Revision  Changes    Path
  1.3       +40 -23    xml-forrest/src/resources/skins/common/xslt/html/book2menu.xsl
  
  Index: book2menu.xsl
  ===================================================================
  RCS file: /home/cvs/xml-forrest/src/resources/skins/common/xslt/html/book2menu.xsl,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- book2menu.xsl	16 Nov 2002 23:01:48 -0000	1.2
  +++ book2menu.xsl	17 Nov 2002 00:00:02 -0000	1.3
  @@ -11,31 +11,41 @@
   
   <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
   
  -  <xsl:template match="menu">
  -    <div class="menu">
  -      <xsl:call-template name="base-menu"/>
  -    </div>
  +  <!-- ================================================================ -->
  +  <!-- These templates SHOULD be overridden                             -->
  +  <!-- ================================================================ -->
  +
  +  <xsl:template name="selected">
  +    <xsl:value-of select="@label"/>
     </xsl:template>
   
  -  <xsl:template name="base-menu">
  -    <xsl:apply-templates/>
  +  <xsl:template name="unselected">
  +    <a href="{@href}"><xsl:value-of select="@label"/></a>
     </xsl:template>
   
  -  <xsl:param name="path"/>
  +  <xsl:template name="print-external">
  +    <!-- Use apply-imports when overriding -->
  +    <xsl:value-of select="@label"/>
  +  </xsl:template>
   
  -  <xsl:include href="pathutils.xsl"/>
   
  -  <xsl:variable name="filename-noext">
  -    <xsl:call-template name="filename-noext">
  -      <xsl:with-param name="path" select="$path"/>
  -    </xsl:call-template>
  -  </xsl:variable>
  +  <!-- ================================================================ -->
  +  <!-- These templates CAN be overridden                                -->
  +  <!-- ================================================================ -->
   
     <xsl:template match="book">
       <xsl:apply-templates select="menu"/>
     </xsl:template>
   
  +
  +  <xsl:template match="menu">
  +    <div class="menu">
  +      <xsl:call-template name="base-menu"/>
  +    </div>
  +  </xsl:template>
  +
     <xsl:template match="menu-item">
  +    <!-- Use apply-imports when overriding -->
       <xsl:choose>
         <xsl:when test="starts-with(@href, $filename-noext)">
           <xsl:call-template name="selected"/>
  @@ -46,17 +56,20 @@
       </xsl:choose>
     </xsl:template>
   
  -  <xsl:template name="selected">
  -    <xsl:value-of select="@label"/>
  -  </xsl:template>
  +  <!-- ================================================================ -->
  +  <!-- These templates SHOULD NOT be overridden                         -->
  +  <!-- ================================================================ -->
   
  -  <xsl:template name="unselected">
  -    <a href="{@href}"><xsl:value-of select="@label"/></a>
  -  </xsl:template>
   
  -  <xsl:template name="print-external">
  -    <xsl:value-of select="@label"/>
  -  </xsl:template>
  +  <xsl:param name="path"/>
  +
  +  <xsl:include href="pathutils.xsl"/>
  +
  +  <xsl:variable name="filename-noext">
  +    <xsl:call-template name="filename-noext">
  +      <xsl:with-param name="path" select="$path"/>
  +    </xsl:call-template>
  +  </xsl:variable>
   
     <xsl:template match="external">
       <li>
  @@ -76,5 +89,9 @@
     <xsl:template match="menu-item[@type='hidden']"/>
   
     <xsl:template match="external[@type='hidden']"/>
  +
  +  <xsl:template name="base-menu">
  +    <xsl:apply-templates/>
  +  </xsl:template>
   
   </xsl:stylesheet>
  
  
  
  1.3       +10 -7     xml-forrest/src/resources/skins/common/xslt/html/tab2menu.xsl
  
  Index: tab2menu.xsl
  ===================================================================
  RCS file: /home/cvs/xml-forrest/src/resources/skins/common/xslt/html/tab2menu.xsl,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- tab2menu.xsl	16 Nov 2002 23:01:48 -0000	1.2
  +++ tab2menu.xsl	17 Nov 2002 00:00:02 -0000	1.3
  @@ -29,12 +29,6 @@
     <!-- These templates SHOULD be overridden                             -->
     <!-- ================================================================ -->
   
  -  <xsl:template match="tabs">
  -    <div class="tab">
  -      <xsl:call-template name="base-tabs"/>
  -    </div>
  -  </xsl:template>
  -
     <!-- Called before first tag -->
     <xsl:template name="pre-separator">
     </xsl:template>
  @@ -64,6 +58,15 @@
     </xsl:template>
   
   
  +  <!-- ================================================================ -->
  +  <!-- These templates CAN be overridden                             -->
  +  <!-- ================================================================ -->
  +
  +  <xsl:template match="tabs">
  +    <div class="tab">
  +      <xsl:call-template name="base-tabs"/>
  +    </div>
  +  </xsl:template>
   
   
     <!-- ================================================================ -->
  
  
  

Mime
View raw message