incubator-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ran...@apache.org
Subject cvs commit: incubator-ftpserver/src/doc/skins/common/xslt/html book2menu.xsl document2html.xsl dotdots.xsl pathutils.xsl renderlogo.xsl site2xhtml.xsl split.xsl tab2menu.xsl tabutils.xsl
Date Wed, 07 Sep 2005 05:10:46 GMT
rana_b      2005/09/06 22:10:46

  Added:       src/doc/skins/common/xslt/html book2menu.xsl
                        document2html.xsl dotdots.xsl pathutils.xsl
                        renderlogo.xsl site2xhtml.xsl split.xsl
                        tab2menu.xsl tabutils.xsl
  Log:
  New documentation - POI look and feel
  
  Revision  Changes    Path
  1.1                  incubator-ftpserver/src/doc/skins/common/xslt/html/book2menu.xsl
  
  Index: book2menu.xsl
  ===================================================================
  <?xml version="1.0"?>
  <!-- Copyright (C) 2004 The Apache Software Foundation. All rights reserved. -->
  <!--
  book2menu.xsl generates the HTML menu. It outputs XML/HTML of the form:
    <div class="menu">
       ...
    </div>
  which is then merged with other HTML by site2xhtml.xsl
  
  $Id: book2menu.xsl,v 1.1 2005/09/07 05:10:46 rana_b Exp $
  -->
  
  <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  
    <!-- ================================================================ -->
    <!-- These templates SHOULD be overridden                             -->
    <!-- ================================================================ -->
  
    <xsl:template name="selected">
      <xsl:value-of select="@label"/>
    </xsl:template>
  
    <xsl:template name="unselected">
      <a href="{@href}">
        <xsl:if test="@description">
          <xsl:attribute name="title">
            <xsl:value-of select="@description"/>
          </xsl:attribute>
        </xsl:if>
        <xsl:value-of select="@label"/>
      </a>
    </xsl:template>
  
    <xsl:template name="print-external">
      <!-- Use apply-imports when overriding -->
      <xsl:value-of select="@label"/>
    </xsl:template>
  
  
    <!-- ================================================================ -->
    <!-- These templates CAN be overridden                                -->
    <!-- ================================================================ -->
  
    <!-- Eg, if tab href is 'index.html#foo', this will be called when index.html
    is selected -->
    <xsl:template name="selected-anchor">
      <!-- By default, render as unselected so that it is clickable (takes user
      to the anchor) -->
      <xsl:call-template name="unselected"/>
    </xsl:template>
  
    <xsl:template name="unselected-anchor">
      <xsl:call-template name="unselected"/>
    </xsl:template>
  
  
    <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:variable name="href-nofrag">
        <xsl:call-template name="path-nofrag">
          <xsl:with-param name="path" select="@href"/>
        </xsl:call-template>
      </xsl:variable>
  
      <xsl:variable name="node-path">
        <xsl:call-template name="normalize">
          <xsl:with-param name="path" select="concat($dirname, $href-nofrag)"/>
        </xsl:call-template>
      </xsl:variable>
  
      <xsl:choose>
        <!-- Compare with extensions stripped -->
        <xsl:when test="$node-path = $path-nofrag">
          <xsl:choose>
            <xsl:when test="contains(@href, '#')">
              <xsl:call-template name="selected-anchor"/>
            </xsl:when>
            <xsl:otherwise>
              <xsl:call-template name="selected"/>
            </xsl:otherwise>
          </xsl:choose>
        </xsl:when>
        <xsl:otherwise>
          <xsl:choose>
            <xsl:when test="contains(@href, '#')">
              <xsl:call-template name="unselected-anchor"/>
            </xsl:when>
            <xsl:otherwise>
              <xsl:call-template name="unselected"/>
            </xsl:otherwise>
          </xsl:choose>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>
  
    <!-- ================================================================ -->
    <!-- These templates SHOULD NOT be overridden                         -->
    <!-- ================================================================ -->
  
  
    <xsl:param name="path"/>
  
    <xsl:include href="pathutils.xsl"/>
  
    <xsl:variable name="filename">
      <xsl:call-template name="filename">
        <xsl:with-param name="path" select="$path"/>
      </xsl:call-template>
    </xsl:variable>
  
    <xsl:variable name="path-nofrag">
      <xsl:call-template name="path-nofrag">
        <xsl:with-param name="path" select="$path"/>
      </xsl:call-template>
    </xsl:variable>
  
    <xsl:variable name="path-nofrag">
      <xsl:call-template name="path-nofrag">
        <xsl:with-param name="path" select="$path"/>
      </xsl:call-template>
    </xsl:variable>
  
    <xsl:variable name="dirname">
      <xsl:call-template name="dirname">
        <xsl:with-param name="path" select="$path"/>
      </xsl:call-template>
    </xsl:variable>
  
    <xsl:template match="external">
      <li>
        <xsl:choose>
          <xsl:when test="starts-with(@href, $path-nofrag)">
            <span class="externalSelected">
              <xsl:call-template name="print-external"/>
            </span>
          </xsl:when>
          <xsl:otherwise>
            <a href="{@href}" target="_blank"><xsl:value-of select="@label"/></a>
          </xsl:otherwise>
        </xsl:choose>
      </li>
    </xsl:template>
  
    <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.1                  incubator-ftpserver/src/doc/skins/common/xslt/html/document2html.xsl
  
  Index: document2html.xsl
  ===================================================================
  <?xml version="1.0"?>
  <!-- Copyright (C) 2004 The Apache Software Foundation. All rights reserved. -->
  <!--
  This stylesheet contains the majority of templates for converting documentv11
  to HTML.  It renders XML as HTML in this form:
  
    <div class="content">
     ...
    </div>
  
  ..which site2xhtml.xsl then combines with HTML from the index (book2menu.xsl)
  and tabs (tab2menu.xsl) to generate the final HTML.
  
  Section handling
    - <a name/> anchors are added if the id attribute is specified
  
  $Id: document2html.xsl,v 1.1 2005/09/07 05:10:46 rana_b Exp $
  -->
  <xsl:stylesheet version="1.0" 
                  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  
    <!-- the skinconf file -->
    <xsl:param name="config-file" select="'../../../../skinconf.xml'"/>
    <xsl:variable name="config" select="document($config-file)/skinconfig"/>
    
    <!-- If true, a PDF link for this page will not be generated -->
    <xsl:variable name="disable-pdf-link" select="$config/disable-pdf-link"/>
    <!-- If true, a "print" link for this page will not be generated -->
    <xsl:variable name="disable-print-link" select="$config/disable-print-link"/>
    <!-- If true, an XML link for this page will not be generated -->
    <xsl:variable name="disable-xml-link" select="$config/disable-xml-link"/>  
    <!-- Get the section depth to use when generating the minitoc (default is 2) -->
    <xsl:variable name="config-max-depth" select="$config/toc/@level"/>
    <!-- Whether to obfuscate email links -->
    <xsl:variable name="obfuscate-mail-links" select="$config/obfuscate-mail-links"/>
  
    <xsl:variable name="max-depth">
      <xsl:choose>
        <xsl:when test="string-length($config-max-depth)&gt;0">
          <xsl:value-of select="$config-max-depth"/>
        </xsl:when>
        <xsl:otherwise>2</xsl:otherwise>
      </xsl:choose>
    </xsl:variable>
      
    <xsl:param name="notoc"/>
    <xsl:param name="path"/>
    <!-- <xsl:include href="split.xsl"/> -->
    <xsl:include href="dotdots.xsl"/>
    <xsl:include href="pathutils.xsl"/>
  
    <!-- Path to site root, eg '../../' -->
    <xsl:variable name="root">
      <xsl:call-template name="dotdots">
        <xsl:with-param name="path" select="$path"/>
      </xsl:call-template>
    </xsl:variable>
  
    <xsl:variable name="filename-noext">
      <xsl:call-template name="filename-noext">
        <xsl:with-param name="path" select="$path"/>
      </xsl:call-template>
    </xsl:variable>
   
    <xsl:variable name="skin-img-dir" select="concat(string($root), 'skin/images')"/>
  
    <xsl:template match="document">
      <div class="content">
        <table summary="" class="title">
          <tr> 
            <td valign="middle"> 
              <xsl:if test="normalize-space(header/title)!=''">
                <h1>
                  <xsl:value-of select="header/title"/>
                </h1>
              </xsl:if>
            </td>
            <xsl:call-template name="printlink"/> 
            <xsl:call-template name="pdflink"/>
            <xsl:call-template name="xmllink"/>
          </tr>
        </table>
        <xsl:if test="normalize-space(header/subtitle)!=''">
          <h3>
            <xsl:value-of select="header/subtitle"/>
          </h3>
        </xsl:if>
        <xsl:apply-templates select="header/type"/>
        <xsl:apply-templates select="header/notice"/>
        <xsl:apply-templates select="header/abstract"/>
        <xsl:apply-templates select="body"/>
        <div class="attribution">
          <xsl:apply-templates select="header/authors"/>
          <xsl:if test="header/authors and header/version">
            <xsl:text>; </xsl:text>
          </xsl:if>
          <xsl:apply-templates select="header/version"/>
        </div>
      </div>
    </xsl:template>
  
    <!-- Generates the "printer friendly version" link -->
    <xsl:template name="printlink">
      <xsl:if test="$disable-print-link = 'false'"> 
  <script type="text/javascript" language="Javascript">
  function printit() {  
  if (window.print) {
      window.print() ;  
  } else {
      var WebBrowser = '&lt;OBJECT ID="WebBrowser1" WIDTH="0" HEIGHT="0" CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2">&lt;/OBJECT>';
  document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
      WebBrowser1.ExecWB(6, 2);//Use a 1 vs. a 2 for a prompting dialog box    WebBrowser1.outerHTML = "";  
  }
  }
  </script>
  
  <script type="text/javascript" language="Javascript">
  var NS = (navigator.appName == "Netscape");
  var VERSION = parseInt(navigator.appVersion);
  if (VERSION > 3) {
      document.write('<td align="center" width="40" nowrap="nowrap">');
      document.write('  <a href="javascript:printit()" class="dida">');
      document.write('    <img class="skin" src="{$skin-img-dir}/printer.gif" alt="Print this Page"/><br />');
      document.write('  print</a>');
      document.write('</td>');
  }
  </script>
  
      </xsl:if>
    </xsl:template>
  
    <!-- Generates the PDF link -->
    <xsl:template name="pdflink">
      <xsl:if test="not($config/disable-pdf-link) or $disable-pdf-link = 'false'"> 
        <td align="center" width="40" nowrap="nowrap"><a href="{$filename-noext}.pdf" class="dida">
            <img class="skin" src="{$skin-img-dir}/pdfdoc.gif" alt="PDF"/><br/>
            PDF</a>
        </td>
      </xsl:if>
    </xsl:template>
    
  
    <!-- Generates the XML link -->
    <xsl:template name="xmllink">
      <xsl:if test="$disable-xml-link = 'false'">
        <td align="center" width="40" nowrap="nowrap"><a href="{$filename-noext}.xml" class="dida">
            <img class="skin" src="{$skin-img-dir}/xmldoc.gif" alt="xml"/><br/>
            xml</a>
        </td>
      </xsl:if>
    </xsl:template>
    
    <xsl:template match="body">
      <xsl:if test="$max-depth&gt;0 and not($notoc='true')" >
        <xsl:call-template name="minitoc">
          <xsl:with-param name="tocroot" select="."/>
          <xsl:with-param name="depth">1</xsl:with-param>
        </xsl:call-template>
      </xsl:if>
      <xsl:apply-templates/>
    </xsl:template>
  
  
    <!-- Generate a <a name="..."> tag for an @id -->
    <xsl:template match="@id">
      <xsl:if test="normalize-space(.)!=''">
        <a name="{.}"/>
      </xsl:if>
    </xsl:template>
  
    <xsl:template match="section">
      <!-- count the number of section in the ancestor-or-self axis to compute
           the title element name later on -->
      <xsl:variable name="sectiondepth" select="count(ancestor-or-self::section)"/>
      <a name="{generate-id()}"/>
      <xsl:apply-templates select="@id"/>
      <!-- generate a title element, level 1 -> h3, level 2 -> h4 and so on... -->
      <xsl:element name="{concat('h',$sectiondepth + 2)}">
        <xsl:value-of select="title"/>
        <xsl:if test="$notoc='true' and $sectiondepth = 3">
          <span style="float: right"><a href="#{@id}-menu">^</a></span>
        </xsl:if>
      </xsl:element>
  
      <!-- Indent FAQ entry text 15 pixels -->
      <xsl:variable name="indent">
        <xsl:choose>
          <xsl:when test="$notoc='true' and $sectiondepth = 3">
            <xsl:text>15</xsl:text>
          </xsl:when>
          <xsl:otherwise>
            <xsl:text>0</xsl:text>
          </xsl:otherwise>
        </xsl:choose>
      </xsl:variable>
  
      <div style="margin-left: {$indent} ; border: 2px">
            <xsl:apply-templates select="*[not(self::title)]"/>
      </div>
    </xsl:template>
  
    <xsl:template match="note | warning | fixme">
      <xsl:apply-templates select="@id"/>
      <div class="frame {local-name()}">
        <div class="label">
          <xsl:choose>
            <xsl:when test="@label"><xsl:value-of select="@label"/></xsl:when>
            <xsl:when test="local-name() = 'note'">Note</xsl:when>
            <xsl:when test="local-name() = 'warning'">Warning</xsl:when>
            <xsl:otherwise>Fixme (<xsl:value-of select="@author"/>)</xsl:otherwise>
          </xsl:choose>
        </div>
        <div class="content">
          <xsl:apply-templates/>
        </div>
      </div>
    </xsl:template>
  
    <xsl:template match="notice">
      <div class="notice">
      <!-- FIXME: i18n Transformer here -->
      <xsl:text>Notice: </xsl:text>
        <xsl:apply-templates/>
      </div>
    </xsl:template>
  
    <xsl:template match="link">
      <xsl:apply-templates select="@id"/>
      <xsl:choose>
        <xsl:when test="$obfuscate-mail-links='true' and starts-with(@href, 'mailto:') and contains(@href, '@')">
          <xsl:variable name="mailto-1" select="substring-before(@href,'@')"/>
          <xsl:variable name="mailto-2" select="substring-after(@href,'@')"/>
            <a href="{$mailto-1}.at.{$mailto-2}">
              <xsl:apply-templates/>
            </a>
         </xsl:when>
         <xsl:otherwise>
            <a href="{@href}">
              <xsl:apply-templates/>
            </a>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>
  
    <xsl:template match="jump">
      <xsl:apply-templates select="@id"/>
      <a href="{@href}" target="_top">
        <xsl:apply-templates/>
      </a>
    </xsl:template>
  
    <xsl:template match="fork">
      <xsl:apply-templates select="@id"/>
      <a href="{@href}" target="_blank">
        <xsl:apply-templates/>
      </a>
    </xsl:template>
  
    <xsl:template match="p[@xml:space='preserve']">
      <xsl:apply-templates select="@id"/>
      <div class="pre">
        <xsl:apply-templates/>
      </div>
    </xsl:template>
  
    <xsl:template match="source">
      <xsl:apply-templates select="@id"/>
      <pre class="code">
  <!-- Temporarily removed long-line-splitter ... gives out-of-memory problems -->
        <xsl:apply-templates/>
  <!--
      <xsl:call-template name="format">
      <xsl:with-param select="." name="txt" /> 
       <xsl:with-param name="width">80</xsl:with-param> 
       </xsl:call-template>
  -->
      </pre>
    </xsl:template>
  
    <xsl:template match="anchor">
      <a name="{@id}"/>
    </xsl:template>
  
    <xsl:template match="icon">
      <xsl:apply-templates select="@id"/>
      <img src="{@src}" alt="{@alt}" class="icon">
        <xsl:if test="@height">
          <xsl:attribute name="height"><xsl:value-of select="@height"/></xsl:attribute>
        </xsl:if>
        <xsl:if test="@width">
          <xsl:attribute name="width"><xsl:value-of select="@width"/></xsl:attribute>
        </xsl:if>
      </img>
    </xsl:template>
  
    <xsl:template match="code">
      <xsl:apply-templates select="@id"/>
      <span class="codefrag"><xsl:value-of select="."/></span>
    </xsl:template>
  
    <xsl:template match="figure">
      <xsl:apply-templates select="@id"/>
      <div align="center">
        <img src="{@src}" alt="{@alt}" class="figure">
          <xsl:if test="@height">
            <xsl:attribute name="height"><xsl:value-of select="@height"/></xsl:attribute>
          </xsl:if>
          <xsl:if test="@width">
            <xsl:attribute name="width"><xsl:value-of select="@width"/></xsl:attribute>
          </xsl:if>
        </img>
      </div>
    </xsl:template>
  
    <xsl:template match="table">
      <xsl:apply-templates select="@id"/>
      <table cellpadding="4" cellspacing="1" class="ForrestTable">
        <xsl:if test="@cellspacing"><xsl:attribute name="cellspacing"><xsl:value-of select="@cellspacing"/></xsl:attribute></xsl:if>
        <xsl:if test="@cellpadding"><xsl:attribute name="cellpadding"><xsl:value-of select="@cellpadding"/></xsl:attribute></xsl:if>
        <xsl:if test="@border"><xsl:attribute name="border"><xsl:value-of select="@border"/></xsl:attribute></xsl:if>
        <xsl:if test="@class"><xsl:attribute name="class"><xsl:value-of select="@class"/></xsl:attribute></xsl:if>
        <xsl:if test="@bgcolor"><xsl:attribute name="bgcolor"><xsl:value-of select="@bgcolor"/></xsl:attribute></xsl:if>
        <xsl:apply-templates/>
      </table>
    </xsl:template>
  
    <xsl:template match="acronym/@title">
      <xsl:attribute name="title">
        <xsl:value-of select="normalize-space(.)"/>
      </xsl:attribute>
    </xsl:template>
  
    <xsl:template name="minitoc">  
      <xsl:param name="tocroot"/>
      <xsl:param name="depth"/>     
      <xsl:if test="count($tocroot/section) > 0">
        <ul class="minitoc">
          <xsl:for-each select="$tocroot/section">
            <li>
              <xsl:call-template name="toclink"/>
              <xsl:if test="$depth&lt;$max-depth">
                <xsl:call-template name="minitoc">
                  <xsl:with-param name="tocroot" select="."/>
                  <xsl:with-param name="depth" select="$depth + 1"/>
                </xsl:call-template>
              </xsl:if>
            </li>
          </xsl:for-each>
        </ul>
      </xsl:if>
    </xsl:template>
  
    <xsl:template name="toclink">
      <xsl:variable name="tocitem" select="normalize-space(title)"/>
      <xsl:if test="string-length($tocitem)>0">
        <a>
          <xsl:attribute name="href">
            <xsl:text>#</xsl:text>
            <xsl:if test="@id">
              <xsl:value-of select="@id"/>
            </xsl:if>
          </xsl:attribute>
          <xsl:value-of select="$tocitem"/>
        </a>
      </xsl:if>
    </xsl:template>
  
    <xsl:template match="header/authors">
      <xsl:for-each select="person">
        <xsl:choose>
          <xsl:when test="position()=1">by&#160;</xsl:when>
          <xsl:otherwise>,&#160;</xsl:otherwise>
        </xsl:choose>
        <xsl:value-of select="@name"/>
      </xsl:for-each>
    </xsl:template>
  
    <xsl:template match="version">
      <span class="version">
        <xsl:apply-templates select="@major"/>
        <xsl:apply-templates select="@minor"/>
        <xsl:apply-templates select="@fix"/>
        <xsl:apply-templates select="@tag"/>
        <xsl:choose>
          <xsl:when test="starts-with(., '$Revision: ')">
            version <xsl:value-of select="substring(., 12, string-length(.) -11-2)"/>
          </xsl:when>
          <xsl:otherwise>
            <xsl:value-of select="."/>
          </xsl:otherwise>
        </xsl:choose>
      </span>
    </xsl:template>
    
    <xsl:template match="@major">
       v<xsl:value-of select="."/>
    </xsl:template>
    
    <xsl:template match="@minor">
       <xsl:value-of select="concat('.',.)"/>
    </xsl:template>
    
    <xsl:template match="@fix">
       <xsl:value-of select="concat('.',.)"/>
    </xsl:template>
    
    <xsl:template match="@tag">
       <xsl:value-of select="concat('-',.)"/>
    </xsl:template>
  
    <xsl:template match="type">
      <p class="type">
      <!-- FIXME: i18n Transformer here -->
      <xsl:text>Type: </xsl:text>
      <xsl:value-of select="."/>
      </p>
    </xsl:template>
  
    <xsl:template match="abstract">
      <p>
        <xsl:apply-templates/>
      </p>
    </xsl:template>
  
    <xsl:template name="email">
      <a>
      <xsl:attribute name="href">
        <xsl:choose>
        <xsl:when test="$obfuscate-mail-links='true'">
          <xsl:variable name="user" select="substring-before(@email,'@')"/>
  	<xsl:variable name="host" select="substring-after(@email,'@')"/>
  	<xsl:value-of select="concat('mailto:',$user,'.at.',$host)"/>
        </xsl:when>
        <xsl:otherwise>
          <xsl:value-of select="concat('mailto:',@email)"/>
        </xsl:otherwise>
        </xsl:choose>
      </xsl:attribute>
         <xsl:value-of select="@name"/>
      </a>
    </xsl:template>
  
    <xsl:template match="node()|@*" priority="-1">
      <xsl:copy>
        <xsl:apply-templates select="@*"/>
        <xsl:apply-templates/>
      </xsl:copy>
    </xsl:template>
    
  </xsl:stylesheet>
  
  
  
  
  1.1                  incubator-ftpserver/src/doc/skins/common/xslt/html/dotdots.xsl
  
  Index: dotdots.xsl
  ===================================================================
  <?xml version="1.0" encoding="utf-8"?>
  <!-- Copyright (C) 2004 The Apache Software Foundation. All rights reserved. -->
  
  <!--
  Contains the 'dotdots' template, which, given a path, will output a set of
  directory traversals to get back to the source directory. Handles both '/' and
  '\' directory separators.
  
  Examples:
    Input                           Output 
      index.html                    ""
      dir/index.html                "../"
      dir/subdir/index.html         "../../"
      dir//index.html              "../"
      dir/                          "../"
      dir//                         "../"
      \some\windows\path            "../../"
      \some\windows\path\           "../../../"
      \Program Files\mydir          "../"
  
  Cannot handle ..'s in the path, so don't expect 'dir/subdir/../index.html' to
  work.
  
  jefft@apache.org
  -->
  
  <xsl:stylesheet
    version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  
    <xsl:template name="dotdots">
      <xsl:param name="path"/>
      <xsl:variable name="dirs" select="normalize-space(translate(concat($path, 'x'), ' /\', '_  '))"/>
      <!-- The above does the following:
         o Adds a trailing character to the path. This prevents us having to deal
           with the special case of ending with '/'
         o Translates all directory separators to ' ', and normalize spaces,
  		 cunningly eliminating duplicate '//'s. We also translate any real
  		 spaces into _ to preserve them.
      -->
      <xsl:variable name="remainder" select="substring-after($dirs, ' ')"/>
      <xsl:if test="$remainder">
        <xsl:text>../</xsl:text>
        <xsl:call-template name="dotdots">
          <xsl:with-param name="path" select="translate($remainder, ' ', '/')"/>
  		<!-- Translate back to /'s because that's what the template expects. -->
        </xsl:call-template>
      </xsl:if>
    </xsl:template>
  
  <!--
    Uncomment to test.
    Usage: saxon dotdots.xsl dotdots.xsl path='/my/test/path'
  
    <xsl:param name="path"/>
    <xsl:template match="/">
      <xsl:message>Path: <xsl:value-of select="$path"/></xsl:message>
      <xsl:call-template name="dotdots">
        <xsl:with-param name="path" select="$path"/>
      </xsl:call-template>
    </xsl:template>
   -->
  
  </xsl:stylesheet>
  
  
  
  1.1                  incubator-ftpserver/src/doc/skins/common/xslt/html/pathutils.xsl
  
  Index: pathutils.xsl
  ===================================================================
  <!-- Copyright (C) 2004 The Apache Software Foundation. All rights reserved. -->
  <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <!--
  PathUtils.xsl
  
  A set of XSLT templates useful for parsing URI paths:
  
  dirname: return the directory part of a path
  filename: return the file part of a path
  ext: return the last extension of the filename in a path
  filename-noext: return the file part of a path without its last extension
  
  @author Jeff Turner <jefft@apache.org>
  $Id: pathutils.xsl,v 1.1 2005/09/07 05:10:46 rana_b Exp $
  -->
  
  <!-- Returns the directory part of a path.  Equivalent to Unix 'dirname'.
  Examples:
  '' -> ''
  'foo/index.html' -> 'foo/'
  -->
  <xsl:template name="dirname">
    <xsl:param name="path" />
    <xsl:if test="contains($path, '/')">
      <xsl:value-of select="concat(substring-before($path, '/'), '/')" />
      <xsl:call-template name="dirname">
        <xsl:with-param name="path"
          select="substring-after($path, '/')" />
      </xsl:call-template>
    </xsl:if>
  </xsl:template>
  
  <!-- Normalized (..'s eliminated) version of 'dirname' -->
  <xsl:template name="dirname-nz">
    <xsl:param name="path" />
    <xsl:call-template name="normalize">
      <xsl:with-param name="path">
        <xsl:call-template name="dirname">
          <xsl:with-param name="path" select="$path" />
        </xsl:call-template>
      </xsl:with-param>
    </xsl:call-template>
  </xsl:template>
  
  
  <!-- Returns the filename part of a path.  Equivalent to Unix 'basename'
  Examples:
  'index.html'  ->  'index.html' 
  'foo/bar/'  ->  '' 
  'foo/bar/index.html'  ->  'index.html' 
  -->
  <xsl:template name="filename">
    <xsl:param name="path"/>
    <xsl:choose>
      <xsl:when test="contains($path, '/')">
        <xsl:call-template name="filename">
          <xsl:with-param name="path" select="substring-after($path, '/')"/>
        </xsl:call-template>
      </xsl:when>
      <xsl:otherwise>
        <xsl:value-of select="$path"/>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:template>
  
  <!-- Returns the last extension of a filename in a path.
  Examples:
  'index.html'  ->  '.html' 
  'index.dtdx.html'  ->  '.html' 
  'foo/bar/'  ->  '' 
  'foo/bar/index.html'  ->  '.html' 
  'foo/bar/index'  ->  '' 
  -->
  <xsl:template name="ext">
    <xsl:param name="path"/>
    <xsl:param name="subflag"/> <!-- Outermost call? -->
    <xsl:choose>
      <xsl:when test="contains($path, '.')">
        <xsl:call-template name="ext">
          <xsl:with-param name="path" select="substring-after($path, '.')"/>
          <xsl:with-param name="subflag" select="'sub'"/>
        </xsl:call-template>
      </xsl:when>
      <!-- Handle extension-less filenames by returning '' -->
      <xsl:when test="not($subflag) and not(contains($path, '.'))">
        <xsl:text/>
      </xsl:when>
      <xsl:otherwise>
        <xsl:value-of select="concat('.', $path)"/>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:template>
  
  <!-- Returns a filename of a path stripped of its last extension.
  Examples:
  'foo/bar/index.dtdx.html' -> 'index.dtdx'
  -->
  <xsl:template name="filename-noext">
    <xsl:param name="path"/>
    <xsl:variable name="filename">
      <xsl:call-template name="filename">
        <xsl:with-param name="path" select="$path"/>
      </xsl:call-template>
    </xsl:variable>
    <xsl:variable name="ext">
      <xsl:call-template name="ext">
        <xsl:with-param name="path" select="$filename"/>
      </xsl:call-template>
    </xsl:variable>
    <xsl:value-of select="substring($filename, 1, string-length($filename) - string-length($ext))"/>
  </xsl:template>
  
  <!-- Returns a path with the filename stripped of its last extension.
  Examples:
  'foo/bar/index.dtdx.html' -> 'foo/bar/index.dtdx'
  -->
  <xsl:template name="path-noext">
    <xsl:param name="path"/>
    <xsl:variable name="ext">
      <xsl:call-template name="ext">
        <xsl:with-param name="path" select="$path"/>
      </xsl:call-template>
    </xsl:variable>
    <xsl:value-of select="substring($path, 1, string-length($path) - string-length($ext))"/>
  </xsl:template>
  
  <!-- Normalized (..'s eliminated) version of 'path-noext' -->
  <xsl:template name="path-noext-nz">
    <xsl:param name="path" />
    <xsl:call-template name="normalize">
      <xsl:with-param name="path">
        <xsl:call-template name="path-noext">
          <xsl:with-param name="path" select="$path" />
        </xsl:call-template>
      </xsl:with-param>
    </xsl:call-template>
  </xsl:template>
  
  <!-- Returns a path with any fragment identifier ('#...') stripped off
  Examples:
  'foo/bar/index.dtdx.html#blah' -> 'foo/bar/index.dtdx.html'
  -->
  <xsl:template name="path-nofrag">
    <xsl:param name="path"/>
    <xsl:if test="not(contains($path, '#'))">
      <xsl:value-of select="$path"/>
    </xsl:if>
    <xsl:if test="contains($path, '#')">
      <xsl:value-of select="substring-before($path, '#')"/>
    </xsl:if>
  </xsl:template>
  
  
  
  <!-- Normalizes a path, converting '/' to '\' and eliminating ..'s
  Examples:
  'foo/bar/../baz/index.html' -> foo/baz/index.html'
  -->
  <xsl:template name="normalize">
    <xsl:param name="path"/>
    <xsl:variable name="path-" select="translate($path, '\', '/')"/>
    <xsl:choose>
      <xsl:when test="contains($path-, '/../')">
  
        <xsl:variable name="pa" select="substring-before($path-, '/../')"/>
        <xsl:variable name="th" select="substring-after($path-, '/../')"/>
        <xsl:variable name="pa-">
          <xsl:call-template name="dirname">
            <xsl:with-param name="path" select="$pa"/>
          </xsl:call-template>
        </xsl:variable>
        <xsl:variable name="pa-th" select="concat($pa-, $th)"/>
        <xsl:call-template name="normalize">
          <xsl:with-param name="path" select="$pa-th"/>
        </xsl:call-template>
      </xsl:when>
  
      <xsl:otherwise>
        <xsl:value-of select="$path-"/>
      </xsl:otherwise>
    </xsl:choose>
  
  </xsl:template>
  
  <!--
  Uncomment this to test.
  Usage: saxon pathutils.xsl pathutils.xsl path=foo/bar
  
  <xsl:param name="path" select="'/foo/bar/../baz/index.html'"/>
  <xsl:template match="/">
    <xsl:message>
      path           = <xsl:value-of select="$path"/>
      normalize      = <xsl:call-template name="normalize">
        <xsl:with-param name="path" select="$path"/>
      </xsl:call-template>
      dirname        = <xsl:call-template name="dirname">
        <xsl:with-param name="path" select="$path"/>
      </xsl:call-template>
      dirname-nz     = <xsl:call-template name="dirname-nz">
        <xsl:with-param name="path" select="$path"/>
      </xsl:call-template>
      filename       = <xsl:call-template name="filename">
        <xsl:with-param name="path" select="$path"/>
      </xsl:call-template>
      ext            = <xsl:call-template name="ext">
        <xsl:with-param name="path" select="$path"/>
      </xsl:call-template>
      filename-noext = <xsl:call-template name="filename-noext">
        <xsl:with-param name="path" select="$path"/>
      </xsl:call-template>
      path-noext     = <xsl:call-template name="path-noext">
        <xsl:with-param name="path" select="$path"/>
      </xsl:call-template>
      path-noext-nz  = <xsl:call-template name="path-noext-nz">
        <xsl:with-param name="path" select="$path"/>
      </xsl:call-template>
      path-nofrag    = <xsl:call-template name="path-nofrag">
        <xsl:with-param name="path" select="$path"/>
      </xsl:call-template>
   
    </xsl:message>
  </xsl:template>
  -->
  
  </xsl:stylesheet>
  
  
  
  1.1                  incubator-ftpserver/src/doc/skins/common/xslt/html/renderlogo.xsl
  
  Index: renderlogo.xsl
  ===================================================================
  <?xml version="1.0" encoding="utf-8"?>
  <!-- Copyright (C) 2004 The Apache Software Foundation. All rights reserved. -->
  
  <!--
  A simple callable template that renders a logo for an entity. The logo will 
  be a hyperlink and may include an image (with width and height if specified)
  or else it will just include the specified text.
  
  Note that text and image are mandatory parts of the template.
  -->
  
  <xsl:stylesheet
    version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  
    <xsl:template name="renderlogo">
      <xsl:param name="name"/>
      <xsl:param name="url"/>
      <xsl:param name="logo"/>
      <xsl:param name="width"/>
      <xsl:param name="height"/>
      <xsl:param name="root"/>
      <xsl:param name="description"/>
      <a href="{$url}">
        <xsl:choose>
          <xsl:when test="$logo and not($logo = '')">
            <img alt="{$name}" class="logoImage" border="0">
              <xsl:attribute name="src">
  	      <xsl:if test="not(starts-with($logo, 'http://'))"><xsl:value-of select="$root"/></xsl:if>
                <xsl:value-of select="$logo"/>
              </xsl:attribute>
              <xsl:if test="$width">
                <xsl:attribute name="width"><xsl:value-of select="$width"/></xsl:attribute>
              </xsl:if>
              <xsl:if test="$height">
                <xsl:attribute name="height"><xsl:value-of select="$height"/></xsl:attribute>
              </xsl:if>
              <xsl:if test="$description">
                <xsl:attribute name="title"><xsl:value-of select="$description"/></xsl:attribute>
              </xsl:if>
  	  </img>
          </xsl:when>
          <xsl:otherwise><xsl:value-of select="$name"/></xsl:otherwise>
        </xsl:choose>
      </a>
    </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  incubator-ftpserver/src/doc/skins/common/xslt/html/site2xhtml.xsl
  
  Index: site2xhtml.xsl
  ===================================================================
  <?xml version="1.0"?>
  <!-- Copyright (C) 2004 The Apache Software Foundation. All rights reserved. -->
  <!--
  site2xhtml.xsl is the final stage in HTML page production.  It merges HTML from
  document2html.xsl, tab2menu.xsl and book2menu.xsl, and adds the site header,
  footer, searchbar, css etc.  As input, it takes XML of the form:
  
  <site>
    <div class="menu">
      ...
    </div>
    <div class="tab">
      ...
    </div>
    <div class="content">
      ...
    </div>
  </site>
  
  $Id: site2xhtml.xsl,v 1.1 2005/09/07 05:10:46 rana_b Exp $
  -->
  
  <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  
    <!-- Default skinconf.xml in the skins/ directory -->
    <xsl:param name="config-file" select="'../../../../skinconf.xml'"/>
    <xsl:variable name="config" select="document($config-file)/skinconfig"/>
    <xsl:param name="path"/>
  
    <xsl:include href="dotdots.xsl"/>
    <xsl:include href="pathutils.xsl"/>
    <xsl:include href="renderlogo.xsl"/>
  
    <!-- Path (..'s) to the root directory -->
    <xsl:variable name="root">
      <xsl:call-template name="dotdots">
        <xsl:with-param name="path" select="$path"/>
      </xsl:call-template>
    </xsl:variable>
  
    <!-- Source filename (eg 'foo.xml') of current page -->
    <xsl:variable name="filename">
      <xsl:call-template name="filename">
        <xsl:with-param name="path" select="$path"/>
      </xsl:call-template>
    </xsl:variable>
  
    <xsl:variable name="skin-img-dir" select="concat(string($root), 'skin/images')"/>
    <xsl:variable name="spacer" select="concat($root, 'skin/images/spacer.gif')"/>
  
    <xsl:template match="site">
      <html>
        <head>
          <title><xsl:value-of select="div[@class='content']/table/tr/td/h1"/></title>
        </head>
        <body>
          <xsl:if test="$config/group-url">
            <xsl:call-template name="renderlogo">
              <xsl:with-param name="name" select="$config/group-name"/>
              <xsl:with-param name="url" select="$config/group-url"/>
              <xsl:with-param name="logo" select="$config/group-logo"/>
              <xsl:with-param name="root" select="$root"/>
              <xsl:with-param name="description" select="$config/group-description"/>
            </xsl:call-template>
          </xsl:if>
          <xsl:call-template name="renderlogo">
            <xsl:with-param name="name" select="$config/project-name"/>
            <xsl:with-param name="url" select="$config/project-url"/>
            <xsl:with-param name="logo" select="$config/project-logo"/>
            <xsl:with-param name="root" select="$root"/>
            <xsl:with-param name="description" select="$config/project-description"/>
          </xsl:call-template>
          <xsl:comment>================= start Tabs ==================</xsl:comment>
          <xsl:apply-templates select="div[@class='tab']"/>
          <xsl:comment>================= end Tabs ==================</xsl:comment>
          <xsl:comment>================= start Menu items ==================</xsl:comment>
          <xsl:apply-templates select="div[@class='menu']"/>
          <xsl:comment>================= end Menu items ==================</xsl:comment>
          <xsl:comment>================= start Content==================</xsl:comment>
          <xsl:apply-templates select="div[@class='content']"/>
          <xsl:comment>================= end Content==================</xsl:comment>
  
          <xsl:comment>================= start Footer ==================</xsl:comment>
          Copyright &#169; <xsl:value-of select="$config/year"/>&#160;<xsl:value-of
            select="$config/vendor"/> All rights reserved.
          <script language="JavaScript" type="text/javascript"><![CDATA[<!--
            document.write(" - "+"Last Published: " + document.lastModified);
            //  -->]]></script>
          <xsl:if test="$config/host-logo and not($config/host-logo = '')">
            <a href="{$config/host-url}">
              <xsl:call-template name="renderlogo">
                <xsl:with-param name="name" select="$config/host-name"/>
                <xsl:with-param name="url" select="$config/host-url"/>
                <xsl:with-param name="logo" select="$config/host-logo"/>
                <xsl:with-param name="root" select="$root"/>
              </xsl:call-template>
            </a>
          </xsl:if>
          <xsl:if test="$filename = 'index.html' and $config/credits">
            <xsl:for-each select="$config/credits/credit[not(@role='pdf')]">
              <xsl:call-template name="renderlogo">
                <xsl:with-param name="name" select="name"/>
                <xsl:with-param name="url" select="url"/>
                <xsl:with-param name="logo" select="image"/>
                <xsl:with-param name="root" select="$root"/>
                <xsl:with-param name="width" select="width"/>
                <xsl:with-param name="height" select="height"/>
              </xsl:call-template>
            </xsl:for-each>
          </xsl:if>
          <a href="http://validator.w3.org/check/referer"><img class="skin" border="0"
              src="http://www.w3.org/Icons/valid-html401"
              alt="Valid HTML 4.01!" height="31" width="88"/></a>
        </body>
      </html>
    </xsl:template>
  
    <!-- Add links to any standards-compliance logos -->
    <xsl:template name="compliancy-logos">
      <xsl:if test="$config/disable-compliance-links = 'false'">
        <a href="http://validator.w3.org/check/referer"><img class="logoImage" 
            src="{$skin-img-dir}/valid-html401.png"
            alt="Valid HTML 4.01!" height="31" width="88"/></a>
            
        <a href="http://jigsaw.w3.org/css-validator/"><img class="logoImage" 
            src="{$skin-img-dir}/vcss.png" 
            alt="Valid CSS!" height="31" width="88"/></a>
      </xsl:if>
    </xsl:template>
  
  
    <xsl:template match="node()|@*" priority="-1">
      <xsl:copy>
        <xsl:apply-templates select="@*"/>
        <xsl:apply-templates/>
      </xsl:copy>
    </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  incubator-ftpserver/src/doc/skins/common/xslt/html/split.xsl
  
  Index: split.xsl
  ===================================================================
  <!-- Copyright (C) 2004 The Apache Software Foundation. All rights reserved. -->
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  
  <!--
   This stylesheet was taken from the XSLT FAQ http://www.dpawson.co.uk/xsl/
   
   Comments and adaption to be used without normalize-space()
    by Nicola Ken Barozzi nicolaken@apache.org
  --> 
  
  <!--
    Input:
  
  <doc>
  
  <para>
   123456 2345 343434 545454 43434 343 
   12345 343434 545454 43434 343 
   32345645 343434 545454 43434 343 
   3422222225 343434 545454 43434 343 
   llllllllllllllllllllllooooooooooooooonnnnnnnnnnnggggggggg
   345 343434 545454 43434 343 
  </para>
  
  </doc>
  
  Output:
  
  <HTML>
  <BODY>
  <PRE>123456 2345 343434 545454 
  43434 343 12345 343434 545454 
  43434 343 32345645 343434 
  545454 43434 343 3422222225 
  343434 545454 43434 343 
  lllllllllllllllllllllloooooooo
  ooooooonnnnnnnnnnnggggggggg 
  345 343434 545454 43434 
  343
  </PRE>
  </BODY>
  </HTML>
  
  Fragment ised: 
  
   <xsl:template match="/doc">
   <HTML><BODY><PRE>
      <xsl:call-template name="format">
      <xsl:with-param select="normalize-space(para)" name="txt" /> 
       <xsl:with-param name="width">30</xsl:with-param> 
       </xsl:call-template>
    </PRE></BODY></HTML>
    </xsl:template>
  
  
  -->
  
   <xsl:template match="/body">
     <body>
      <xsl:call-template name="format">
      <xsl:with-param select="source" name="txt" /> 
       <xsl:with-param name="width">40</xsl:with-param> 
       </xsl:call-template>
    </body>
    </xsl:template>
    
    <xsl:template name="format">
      <xsl:param name="txt" /> 
      <xsl:param name="width" /> 
  
      <!-- if there is still text left -->
      <xsl:if test="$txt">
      
      <xsl:variable name = "pretxt" select = "substring($txt,0, $width)" />
      
      <xsl:choose>
        <xsl:when test="contains($pretxt, '&#xA;')">
          <xsl:value-of select="substring-before($pretxt, '&#xA;')"/>
          <xsl:text>&#xA;</xsl:text> 
          <xsl:call-template name="format">
            <xsl:with-param name="txt" select="substring-after($txt,'&#xA;')"/>
            <xsl:with-param select="$width" name="width" />           
          </xsl:call-template>
        </xsl:when>
        
        <xsl:otherwise>
        <!-- get the width at which to break-->
        <xsl:variable name="real-width">
          <xsl:call-template name="tune-width">
            <xsl:with-param select="$txt" name="txt" /> 
            <xsl:with-param select="$width" name="width" /> 
            <xsl:with-param select="$width" name="def" /> 
          </xsl:call-template>
        </xsl:variable>
  
        <!-- output the first part of the broken string -->
        <xsl:value-of select="substring($txt, 1, $real-width)" /> 
  
        <!-- output a newline -->
        <xsl:text>&#xA;</xsl:text> 
  
        <!-- call itself with the remaining part of the text -->
        <xsl:call-template name="format">
         <xsl:with-param select="substring($txt,$real-width + 1)" name="txt" /> 
         <xsl:with-param select="$width" name="width" /> 
        </xsl:call-template>
        </xsl:otherwise>
        </xsl:choose>
      </xsl:if>
    </xsl:template>
    
     
    <!-- used by template "format", it calculates the width at the given def 
         
         It starts at def length and comes back till it finds a space -->
    <xsl:template name="tune-width">
      <xsl:param name="txt" /> 
      <xsl:param name="width" /> 
      <xsl:param name="def" /> 
  
      <xsl:choose>
        <xsl:when test="$width = 0">
         <xsl:value-of select="$def" /> 
        </xsl:when>
                   
        <xsl:when test="substring($txt, $width, 1 ) = ' '">
            <xsl:value-of select="$width" /> 
         </xsl:when>
         
         <xsl:otherwise>
           <!-- otherwise need to tune again, trying with $width - 1 -->
           <xsl:call-template name="tune-width">
             <xsl:with-param select="$width - 1" name="width" /> 
             <xsl:with-param select="$txt" name="txt" /> 
             <xsl:with-param select="$def" name="def" /> 
           </xsl:call-template>
         </xsl:otherwise>
       </xsl:choose>
  
    </xsl:template>
  
    </xsl:stylesheet>
  
  
  
  1.1                  incubator-ftpserver/src/doc/skins/common/xslt/html/tab2menu.xsl
  
  Index: tab2menu.xsl
  ===================================================================
  <?xml version="1.0"?>
  <!-- Copyright (C) 2004 The Apache Software Foundation. All rights reserved. -->
  <!--
  This stylesheet generates 'tabs' at the top left of the screen.  Tabs are
  visual indicators that a certain subsection of the URI space is being browsed.
  For example, if we had tabs with paths:
  
  Tab1:  ''
  Tab2:  'community'
  Tab3:  'community/howto'
  Tab4:  'community/howto/xmlform/index.html'
  
  Then if the current path was 'community/howto/foo', Tab3 would be highlighted.
  The rule is: the tab with the longest path that forms a prefix of the current
  path is enabled.
  
  The output of this stylesheet is HTML of the form:
      <div class="tab">
        ...
      </div>
  
  which is then merged by site2xhtml.xsl
  
  $Id: tab2menu.xsl,v 1.1 2005/09/07 05:10:46 rana_b Exp $
  -->
  
  <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  
    <!-- ================================================================ -->
    <!-- These templates SHOULD be overridden                             -->
    <!-- ================================================================ -->
  
    <!-- Called before first tag -->
    <xsl:template name="pre-separator">
    </xsl:template>
  
    <!-- Called after last tag -->
    <xsl:template name="post-separator">
    </xsl:template>
  
    <!-- Called between tags -->
    <xsl:template name="separator">
      <xsl:text> | </xsl:text>
    </xsl:template>
  
    <!--
    Note: sub-stylesheets can't do apply-imports here, because it would choose
    the 'tags' template and infinitely recurse. Hence call-template used instead.
    -->
  
    <!-- Display a selected tab node -->
    <xsl:template name="selected">
      <xsl:call-template name="base-selected"/>
    </xsl:template>
  
    <!-- Display an unselected tab node -->
    <xsl:template name="not-selected">
      <xsl:call-template name="base-not-selected"/>
    </xsl:template>
  
  
    <!-- ================================================================ -->
    <!-- These templates CAN be overridden                             -->
    <!-- ================================================================ -->
  
    <xsl:template match="tabs">
      <div class="tab">
        <xsl:call-template name="base-tabs"/>
      </div>
    </xsl:template>
  
  
    <!-- ================================================================ -->
    <!-- These templates SHOULD NOT be overridden                         -->
    <!-- ================================================================ -->
  
    <xsl:param name="path"/>
  
    <xsl:include href="dotdots.xsl"/>
    <xsl:include href="tabutils.xsl"/>
  
    <!-- NOTE: Xalan has a bug (race condition?) where sometimes $root is only half-evaluated -->
    <xsl:variable name="root">
      <xsl:call-template name="dotdots">
        <xsl:with-param name="path" select="$path"/>
      </xsl:call-template>
    </xsl:variable>
  
    <xsl:variable name="skin-img-dir" select="concat(string($root), 'skin/images')"/>
  
    <!--
      The longest path of any tab, whose path is a subset of the current URL.  Ie,
      the path of the 'current' tab.
    -->
    <xsl:variable name="longest-dir">
      <xsl:call-template name="longest-dir">
        <xsl:with-param name="tabfile" select="/"/>
      </xsl:call-template>
    </xsl:variable>
  
    <xsl:variable name="matching-id">
      <xsl:call-template name="matching-id">
        <xsl:with-param name="tabfile" select="/"/>
      </xsl:call-template>
    </xsl:variable>
  
  
    <!-- Called from tabs, after it has written the outer 'div class=tabs' and
    any other HTML -->
    <xsl:template name="base-tabs">
      <xsl:call-template name="pre-separator"/>
      <xsl:for-each select="//tab">
        <xsl:if test="position()!=1"><xsl:call-template name="separator"/></xsl:if>
        <xsl:apply-templates select="."/>
      </xsl:for-each>
      <xsl:call-template name="post-separator"/>
    </xsl:template>
  
  
    <xsl:template match="tab">
      <xsl:choose>
        <xsl:when test="@id and @id = $matching-id">
          <xsl:call-template name="selected"/>
        </xsl:when>
        <xsl:when test="not(@id) and @dir = $longest-dir or @href = $longest-dir">
          <xsl:call-template name="selected"/>
        </xsl:when>
        <xsl:otherwise>
          <xsl:call-template name="not-selected"/>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>
  
    <!-- Called from 'selected' -->
    <xsl:template name="base-selected">
      <a class="base-selected">
        <xsl:attribute name="href">
          <xsl:call-template name="calculate-tab-href">
            <xsl:with-param name="tab" select="."/>
            <xsl:with-param name="path" select="$path"/>
          </xsl:call-template>
        </xsl:attribute>
          <xsl:value-of select="@label"/>
      </a>
    </xsl:template>
  
    <!-- Called from 'not-selected' -->
    <xsl:template name="base-not-selected">
      <a class="base-not-selected">
        <xsl:attribute name="href">
          <xsl:call-template name="calculate-tab-href">
            <xsl:with-param name="tab" select="."/>
            <xsl:with-param name="path" select="$path"/>
          </xsl:call-template>
        </xsl:attribute>
          <xsl:value-of select="@label"/>
      </a>
    </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  incubator-ftpserver/src/doc/skins/common/xslt/html/tabutils.xsl
  
  Index: tabutils.xsl
  ===================================================================
  <?xml version="1.0"?>
  <!-- Copyright (C) 2004 The Apache Software Foundation. All rights reserved. -->
  
  <!--
  Some callable templates useful when dealing with tab paths.  Mostly used in
  tab2menu.xsl
  -->
  
  <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  
    <xsl:param name="site-file" select="'cocoon://abs-menulinks'"/>
    <xsl:variable name="site" select="document($site-file)"/>
   
    <!-- Given the current path and a tabs.xml entry, returns a relative path to
    the specified tab's URL.  When rendering a set of tabs, this template will be
    called once per tab.
    -->
    <xsl:template name="calculate-tab-href">
  
      <xsl:param name="dir_index" select="'index.html'"/>
  
      <xsl:param name="tab"/> <!-- current 'tab' node -->
      <xsl:param name="path" select="$path"/>
  
      <xsl:if test="starts-with($tab/@href, 'http')">  <!-- Absolute URL -->
        <xsl:value-of select="$tab/@href"/>
      </xsl:if>
      <xsl:if test="not(starts-with($tab/@href, 'http'))">  <!-- Root-relative path -->
        <xsl:variable name="backpath">
          <xsl:call-template name="dotdots">
            <xsl:with-param name="path" select="$path"/>
          </xsl:call-template>
          <xsl:text>/</xsl:text>
          <xsl:value-of select="$tab/@dir | $tab/@href"/>
          <!-- If we obviously have a directory, add /index.html -->
          <xsl:if test="$tab/@dir or substring($tab/@href, string-length($tab/@href),
            string-length($tab/@href)) = '/'">
            <xsl:text>/</xsl:text>
            <xsl:if test="$tab/@indexfile">
              <xsl:value-of select="$tab/@indexfile"/>
            </xsl:if>
            <xsl:if test="not(@indexfile)">
              <xsl:value-of select="$dir_index"/>
            </xsl:if>
          </xsl:if>
        </xsl:variable>
  
        <xsl:value-of
          select="translate(normalize-space(translate($backpath, ' /', '/ ')), ' /', '/ ')"/>
        <!-- Link to backpath, normalizing slashes -->
      </xsl:if>
    </xsl:template>
  
    <!--
      The id of any tab, whose path is a subset of the current URL.  Ie,
      the path of the 'current' tab.
    -->
    <xsl:template name="matching-id" xmlns:l="http://apache.org/forrest/linkmap/1.0">
      <xsl:value-of select="$site//*[starts-with(@href, $path)]/@tab"/>
    </xsl:template>
   
    <!--
      The longest path of any tab, whose path is a subset of the current URL.  Ie,
      the path of the 'current' tab.
    -->
    <xsl:template name="longest-dir">
      <xsl:param name="tabfile"/>
      <xsl:for-each select="$tabfile/tabs/tab[starts-with($path, @dir|@href)]">
        <xsl:sort select="string-length(@dir|@href)"
          data-type="number" order="descending"/>
        <xsl:if test="position()=1">
          <xsl:value-of select="@dir|@href"/>
        </xsl:if>
      </xsl:for-each>
    </xsl:template>
  
  
  </xsl:stylesheet>
  
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@incubator.apache.org
For additional commands, e-mail: cvs-help@incubator.apache.org


Mime
View raw message