forrest-svn mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From diwa...@apache.org
Subject svn commit: r312564 - in /forrest/trunk/main/webapp/skins/common/xslt/html: book2menu.xsl document2html.xsl site2xhtml.xsl tab2menu.xsl
Date Mon, 10 Oct 2005 05:26:24 GMT
Author: diwaker
Date: Sun Oct  9 22:26:20 2005
New Revision: 312564

URL: http://svn.apache.org/viewcvs?rev=312564&view=rev
Log:
Readd these files to make sure old-views still work

Added:
    forrest/trunk/main/webapp/skins/common/xslt/html/book2menu.xsl   (with props)
    forrest/trunk/main/webapp/skins/common/xslt/html/document2html.xsl   (with props)
    forrest/trunk/main/webapp/skins/common/xslt/html/site2xhtml.xsl   (with props)
    forrest/trunk/main/webapp/skins/common/xslt/html/tab2menu.xsl   (with props)

Added: forrest/trunk/main/webapp/skins/common/xslt/html/book2menu.xsl
URL: http://svn.apache.org/viewcvs/forrest/trunk/main/webapp/skins/common/xslt/html/book2menu.xsl?rev=312564&view=auto
==============================================================================
--- forrest/trunk/main/webapp/skins/common/xslt/html/book2menu.xsl (added)
+++ forrest/trunk/main/webapp/skins/common/xslt/html/book2menu.xsl Sun Oct  9 22:26:20 2005
@@ -0,0 +1,172 @@
+<?xml version="1.0"?>
+<!--
+  Copyright 2002-2005 The Apache Software Foundation or its licensors,
+  as applicable.
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<!--
+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
+
+-->
+
+<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="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>

Propchange: forrest/trunk/main/webapp/skins/common/xslt/html/book2menu.xsl
------------------------------------------------------------------------------
    svn:eol-style = native

Added: forrest/trunk/main/webapp/skins/common/xslt/html/document2html.xsl
URL: http://svn.apache.org/viewcvs/forrest/trunk/main/webapp/skins/common/xslt/html/document2html.xsl?rev=312564&view=auto
==============================================================================
--- forrest/trunk/main/webapp/skins/common/xslt/html/document2html.xsl (added)
+++ forrest/trunk/main/webapp/skins/common/xslt/html/document2html.xsl Sun Oct  9 22:26:20 2005
@@ -0,0 +1,399 @@
+<?xml version="1.0"?>
+<!--
+  Copyright 2002-2005 The Apache Software Foundation or its licensors,
+  as applicable.
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<!--
+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
+
+-->
+<xsl:stylesheet version="1.0"
+                xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+  <xsl:param name="dynamic-page" select="'false'"/>
+  <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="skin-img-dir" select="concat(string($root), 'skin/images')"/>
+
+  <xsl:template match="/">
+    <xsl:apply-templates mode="toc"/>
+    <xsl:apply-templates/>
+  </xsl:template>
+
+  <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>
+          <div id="skinconf-printlink"/>
+          <xsl:if test="$dynamic-page='false'">
+            <div id="skinconf-pdflink"/>
+            <div id="skinconf-xmllink"/>
+          </xsl:if>
+        </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>
+
+  <xsl:template match="body">
+    <div id="skinconf-toc-page"/>
+    <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="{local-name()}">
+      <div class="label">
+        <xsl:choose>
+          <!-- FIXME: i18n Transformer here -->
+          <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"/>
+    <a>
+      <xsl:if test="@class='jump'">
+        <xsl:attribute name="target">_top</xsl:attribute>
+      </xsl:if>
+      <xsl:if test="@class='fork'">
+        <xsl:attribute name="target">_blank</xsl:attribute>
+      </xsl:if>
+      <xsl:copy-of select="@*"/>
+      <xsl:apply-templates/>
+    </a>
+  </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:copy-of select="@id"/>
+      <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:copy-of select="@id"/>
+      <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:copy-of select="@id"/>
+    </a>
+  </xsl:template>
+
+  <xsl:template match="icon">
+    <xsl:apply-templates select="@id"/>
+    <img class="icon">
+      <xsl:copy-of select="@height | @width | @src | @alt | @id"/>
+    </img>
+  </xsl:template>
+
+  <xsl:template match="code">
+    <xsl:apply-templates select="@id"/>
+    <span class="codefrag">
+      <xsl:copy-of select="@id"/>
+      <xsl:value-of select="."/>
+    </span>
+  </xsl:template>
+
+  <xsl:template match="figure">
+    <xsl:apply-templates select="@id"/>
+    
+    <div align="center">
+      <xsl:copy-of select="@id"/>
+      <img class="figure">
+        <xsl:copy-of select="@height | @width | @src | @alt | @id"/>
+      </img>
+    </div>
+  </xsl:template>
+
+  <xsl:template match="table">
+    <xsl:apply-templates select="@id"/>
+    <xsl:choose>
+      <!-- Limit Forrest specific processing to tables without class -->
+      <xsl:when test="not(@class) or @class=''">
+        <table cellpadding="4" cellspacing="1" class="ForrestTable">
+          <xsl:copy-of select="@cellspacing | @cellpadding | @border | @class | @bgcolor |@id"/>
+          <xsl:apply-templates/>
+        </table>    
+      </xsl:when>
+      <xsl:otherwise>
+        <!-- Tables with class are passed without change -->
+        <xsl:copy>
+          <xsl:copy-of select="@*"/>
+          <xsl:apply-templates/>
+        </xsl:copy>    
+        
+      </xsl:otherwise>
+    </xsl:choose>
+    <xsl:if test="@class = ''">
+      
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template match="acronym/@title">
+    <xsl:attribute name="title">
+      <xsl:value-of select="normalize-space(.)"/>
+    </xsl:attribute>
+  </xsl:template>
+
+  <xsl:template match="header/authors">
+    <xsl:for-each select="person">
+      <xsl:choose>
+        <xsl:when test="position()=1">by</xsl:when>
+        <xsl:otherwise>,</xsl:otherwise>
+      </xsl:choose>
+      <xsl:text> </xsl:text>
+      <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 | @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:value-of select="concat('mailto:',@email)"/>
+      </xsl:attribute>
+       <xsl:value-of select="@name"/>
+    </a>
+  </xsl:template>
+
+  <xsl:template name="generate-id">
+    <xsl:choose>
+      <xsl:when test="@id">
+        <xsl:value-of select="@id"/>
+      </xsl:when>
+      <xsl:when test="@title">
+        <xsl:value-of select="@title"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="generate-id(.)"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <!--  Templates for "toc" mode.  This will generate a complete
+        Table of Contents for the document.  This will then be used
+        by the site2xhtml to generate a Menu ToC and a Page ToC -->
+
+  <xsl:template match="document" mode="toc">
+    <xsl:apply-templates mode="toc"/>
+  </xsl:template>
+
+  <xsl:template match="body" mode="toc">
+    <tocitems>
+      <xsl:apply-templates select="section" mode="toc">
+        <xsl:with-param name="level" select="1"/>
+      </xsl:apply-templates>
+    </tocitems>
+  </xsl:template>
+
+  <xsl:template match="section" mode="toc">
+    <xsl:param name="level"/>
+
+    <tocitem level="{$level}">
+      <xsl:attribute name="href">#<xsl:call-template name="generate-id"/></xsl:attribute>
+      <xsl:attribute name="title"><xsl:value-of select="title"/></xsl:attribute>
+      <xsl:apply-templates mode="toc">
+        <xsl:with-param name="level" select="$level+1"/>
+      </xsl:apply-templates>
+    </tocitem>
+  </xsl:template>
+
+  <xsl:template match="node()|@*" mode="toc"/>
+
+  <!-- End of "toc" mode templates -->
+
+  <xsl:template match="node()|@*" priority="-1">
+    <!-- id processing will create its own a-element so processing has to 
+         happen outside the copied element 
+    -->
+    <xsl:apply-templates select="@id"/>
+    <xsl:copy>
+      <xsl:apply-templates select="@*[name(.) != 'id']"/>
+      <xsl:copy-of select="@id"/>
+      <xsl:apply-templates/>
+    </xsl:copy>
+  </xsl:template>
+
+</xsl:stylesheet>
+

Propchange: forrest/trunk/main/webapp/skins/common/xslt/html/document2html.xsl
------------------------------------------------------------------------------
    svn:eol-style = native

Added: forrest/trunk/main/webapp/skins/common/xslt/html/site2xhtml.xsl
URL: http://svn.apache.org/viewcvs/forrest/trunk/main/webapp/skins/common/xslt/html/site2xhtml.xsl?rev=312564&view=auto
==============================================================================
--- forrest/trunk/main/webapp/skins/common/xslt/html/site2xhtml.xsl (added)
+++ forrest/trunk/main/webapp/skins/common/xslt/html/site2xhtml.xsl Sun Oct  9 22:26:20 2005
@@ -0,0 +1,377 @@
+<?xml version="1.0"?>
+<!--
+  Copyright 2002-2005 The Apache Software Foundation or its licensors,
+  as applicable.
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<!--
+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>
+
+-->
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+  <xsl:variable name="config" select="//skinconfig"/>
+  <!-- If true, a txt link for this page will not be generated -->
+  <xsl:variable name="disable-txt-link" select="//skinconfig/disable-txt-link"/>
+  <!-- If true, a PDF link for this page will not be generated -->
+  <xsl:variable name="disable-pdf-link" select="//skinconfig/disable-pdf-link"/>
+  <!-- If true, a "print" link for this page will not be generated -->
+  <xsl:variable name="disable-print-link" select="//skinconfig/disable-print-link"/>
+  <!-- If true, an XML link for this page will not be generated -->
+  <xsl:variable name="disable-xml-link" select="//skinconfig/disable-xml-link"/>
+  <!-- If true, a POD link for this page will not be generated -->
+  <xsl:variable name="disable-pod-link" select="//skinconfig/disable-pod-link"/>
+  <!-- Get the location where to generate the minitoc -->
+  <xsl:variable name="minitoc-location" select="//skinconfig/toc/@location"/>
+
+  <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>
+
+  <!-- Path of Lucene search results page (relative to $root) -->
+  <xsl:param name="lucene-search" select="'lucene-search.html'"/>
+
+  <xsl:variable name="filename-noext">
+    <xsl:call-template name="filename-noext">
+      <xsl:with-param name="path" select="$path"/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <!-- Whether to obfuscate email links -->
+  <xsl:variable name="obfuscate-mail-links" select="//skinconfig/obfuscate-mail-links"/>
+ <!-- If true, the font size script will not be rendered -->
+  <xsl:variable name="disable-font-script" select="//skinconfig/disable-font-script"/>
+  <!-- If true, an the images on all external links will not be added -->
+  <xsl:variable name="disable-external-link-image" select="//skinconfig/disable-external-link-image"/>
+  <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 name="breadcrumbs">
+    <xsl:if test="(//skinconfig/trail/link1/@name)and(//skinconfig/trail/link1/@name!='')"><a href="{//skinconfig/trail/link1/@href}"><xsl:value-of select="//skinconfig/trail/link1/@name"/></a></xsl:if>
+    <xsl:if test="(//skinconfig/trail/link2/@name)and(//skinconfig/trail/link2/@name!='')"> &gt; <a href="{//skinconfig/trail/link2/@href}">  <xsl:value-of select="//skinconfig/trail/link2/@name"/></a> </xsl:if>
+    <xsl:if test="(//skinconfig/trail/link3/@name)and(//skinconfig/trail/link3/@name!='')"> &gt; <a href="{//skinconfig/trail/link3/@href}">  <xsl:value-of select="//skinconfig/trail/link3/@name"/></a> </xsl:if>
+    <script type="text/javascript" language="JavaScript" src="{$root}skin/breadcrumbs.js"/>
+  </xsl:template>
+
+  <xsl:template match="site">
+    <html>
+      <head>
+        <title><xsl:value-of select="div[@class='content']/table/tr/td/h1"/></title>
+        <xsl:if test="//skinconfig/favicon-url">
+          <link rel="shortcut icon">
+            <xsl:attribute name="href">
+              <xsl:value-of select="concat($root,//skinconfig/favicon-url)"/>
+            </xsl:attribute>
+          </link>
+        </xsl:if>
+      </head>
+      <body>
+        <xsl:if test="//skinconfig/group-url">
+          <xsl:call-template name="renderlogo">
+            <xsl:with-param name="name" select="//skinconfig/group-name"/>
+            <xsl:with-param name="url" select="//skinconfig/group-url"/>
+            <xsl:with-param name="logo" select="//skinconfig/group-logo"/>
+            <xsl:with-param name="root" select="$root"/>
+            <xsl:with-param name="description" select="//skinconfig/group-description"/>
+          </xsl:call-template>
+        </xsl:if>
+        <xsl:call-template name="renderlogo">
+          <xsl:with-param name="name" select="//skinconfig/project-name"/>
+          <xsl:with-param name="url" select="//skinconfig/project-url"/>
+          <xsl:with-param name="logo" select="//skinconfig/project-logo"/>
+          <xsl:with-param name="root" select="$root"/>
+          <xsl:with-param name="description" select="//skinconfig/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>
+        <xsl:choose>
+          <xsl:when test="$config/copyright-link">
+            <a>
+              <xsl:attribute name="href">
+                <xsl:value-of select="$config/copyright-link"/>
+              </xsl:attribute>
+            Copyright &#169; <xsl:value-of select="$config/year"/>&#160;
+            <xsl:value-of select="$config/vendor"/>
+            </a>
+          </xsl:when>
+          <xsl:otherwise>
+            Copyright &#169; <xsl:value-of select="$config/year"/>&#160;
+            <xsl:value-of select="$config/vendor"/>
+          </xsl:otherwise>
+        </xsl:choose>
+        All rights reserved.
+        <script language="JavaScript" type="text/javascript"><![CDATA[<!--
+          document.write(" - "+"Last Published: " + document.lastModified);
+          //  -->]]></script>
+        <xsl:if test="//skinconfig/host-logo and not(//skinconfig/host-logo = '')">
+          <a href="{//skinconfig/host-url}">
+            <xsl:call-template name="renderlogo">
+              <xsl:with-param name="name" select="//skinconfig/host-name"/>
+              <xsl:with-param name="url" select="//skinconfig/host-url"/>
+              <xsl:with-param name="logo" select="//skinconfig/host-logo"/>
+              <xsl:with-param name="root" select="$root"/>
+            </xsl:call-template>
+          </a>
+        </xsl:if>
+        <xsl:if test="$filename = 'index.html' and //skinconfig/credits">
+          <xsl:for-each select="//skinconfig/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="$filename = 'index.html' and //skinconfig/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!" title="Valid HTML 4.01!" height="31" width="88" border="0"/></a>
+
+      <a href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logoImage"
+          src="{$skin-img-dir}/vcss.png"
+          alt="Valid CSS!" title="Valid CSS!" height="31" width="88" border="0"/></a>
+    </xsl:if>
+  </xsl:template>
+
+  <!-- Generates the PDF link -->
+  <xsl:template match="div[@id='skinconf-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 TXT link -->
+  <xsl:template match="div[@id='skinconf-txtlink']">
+    <xsl:if test="$disable-txt-link = 'false'">
+      <td align="center" width="40" nowrap="nowrap"><a href="{$filename-noext}.txt" class="dida">
+        <img class="skin" src="{$skin-img-dir}/txtdoc.png" alt="TXT"/><br/>
+        TXT</a>
+      </td>
+    </xsl:if>
+  </xsl:template>
+
+  <!-- Generates the POD link -->
+  <xsl:template match="div[@id='skinconf-podlink']">
+    <xsl:if test="$disable-pod-link = 'false'">
+      <td align="center" width="40" nowrap="nowrap"><a href="{$filename-noext}.pod" class="dida">
+        <img class="skin" src="{$skin-img-dir}/poddoc.png" alt="POD"/><br/>
+        POD</a>
+      </td>
+    </xsl:if>
+  </xsl:template>
+
+  <!-- Generates the XML link -->
+  <xsl:template match="div[@id='skinconf-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>
+
+  <!-- Generates the "printer friendly version" link -->
+  <xsl:template match="div[@id='skinconf-printlink']">
+    <xsl:if test="$disable-print-link = 'false'">
+<script type="text/javascript" language="Javascript">
+function printit() {
+  if (window.print) {
+    window.focus();
+    window.print();
+  }
+}
+
+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>
+
+  <!-- handle all obfuscating mail links and disabling external link images -->
+  <xsl:template match="a">
+    <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,'@')"/>
+        <xsl:variable name="obfuscation" select="normalize-space(//skinconfig/obfuscate-mail-value)"/>
+          <a href="{$mailto-1}{$obfuscation}{$mailto-2}">
+            <xsl:apply-templates/>
+          </a>
+       </xsl:when>
+       <xsl:when test="not($disable-external-link-image='true') and contains(@href, ':') and not(contains(@href, //skinconfig/group-url)) and not(contains(@href, //skinconfig/project-url))">
+          <a href="{@href}" class="external">
+            <xsl:apply-templates/>
+          </a>
+       </xsl:when>
+       <xsl:otherwise>
+        <!-- xsl:copy-of makes sure we copy <a href> as well as <a name>
+             or any other <a ...> forms -->
+        <xsl:copy-of select="."/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template match="div[@id='skinconf-toc-page']">
+    <xsl:if test="$config/toc">
+      <xsl:if test="contains($minitoc-location,'page')">
+        <xsl:if test="count(//tocitems/tocitem) >= $config/toc/@min-sections">
+          <xsl:call-template name="minitoc">
+            <xsl:with-param name="tocroot" select="//tocitems"/>
+          </xsl:call-template>
+        </xsl:if>
+      </xsl:if>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template name="minitoc">
+    <xsl:param name="tocroot"/>
+    <xsl:if test="count($tocroot/tocitem) >= $config/toc/@min-sections">
+    <xsl:if test="contains($config/toc/@location,'page')">
+      <ul class="minitoc">
+        <xsl:for-each select="$tocroot/tocitem">
+          <li>
+            <a href="{@href}">
+              <xsl:value-of select="@title"/>
+            </a>
+            <xsl:if test="@level&lt;//skinconfig/toc/@max-depth+1">
+              <xsl:call-template name="minitoc">
+                <xsl:with-param name="tocroot" select="."/>
+              </xsl:call-template>
+            </xsl:if>
+          </li>
+        </xsl:for-each>
+      </ul>
+    </xsl:if>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template name="html-meta">
+    <meta name="Generator" content="Apache Forrest"/>
+    <meta name="Forrest-version">
+      <xsl:attribute name="content">
+        <xsl:value-of select="//info/forrest-version"/>
+      </xsl:attribute>
+    </meta>
+    <meta name="Forrest-skin-name">
+      <xsl:attribute name="content">
+        <xsl:value-of select="//info/project-skin"/>
+      </xsl:attribute>
+    </meta>
+  </xsl:template>
+
+  <!-- meta information from v 2.0 documents
+       FIXME: the match is really inefficient -->
+  <xsl:template name="meta-data">
+    <xsl:for-each select="//meta-data/meta">
+      <xsl:element name="meta">
+        <xsl:attribute name="name"><xsl:value-of select="@name"/></xsl:attribute>
+        <xsl:attribute name="content"><xsl:value-of select="."/></xsl:attribute>
+        <xsl:if test="@xml:lang">
+          <xsl:attribute name="lang"><xsl:value-of select="@xml:lang"/></xsl:attribute>          
+        </xsl:if>
+      </xsl:element>
+    </xsl:for-each>
+  </xsl:template>
+
+  <xsl:template name="feedback">
+    <div id="feedback">
+      <xsl:value-of select="$config/feedback"/>
+      <xsl:choose>
+        <xsl:when test="$config/feedback/@href and not($config/feedback/@href='')">
+          <a id="feedbackto">
+            <xsl:attribute name="href">
+              <xsl:value-of select="$config/feedback/@href"/>
+              <xsl:value-of select="$path"/>
+            </xsl:attribute>
+            <xsl:value-of select="$config/feedback/@to"/>
+          </a>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="$config/feedback/@to"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </div>
+  </xsl:template>
+
+  <xsl:template match="node()|@*" priority="-1">
+    <xsl:copy>
+      <xsl:apply-templates select="@*"/>
+      <xsl:apply-templates/>
+    </xsl:copy>
+  </xsl:template>
+
+</xsl:stylesheet>

Propchange: forrest/trunk/main/webapp/skins/common/xslt/html/site2xhtml.xsl
------------------------------------------------------------------------------
    svn:eol-style = native

Added: forrest/trunk/main/webapp/skins/common/xslt/html/tab2menu.xsl
URL: http://svn.apache.org/viewcvs/forrest/trunk/main/webapp/skins/common/xslt/html/tab2menu.xsl?rev=312564&view=auto
==============================================================================
--- forrest/trunk/main/webapp/skins/common/xslt/html/tab2menu.xsl (added)
+++ forrest/trunk/main/webapp/skins/common/xslt/html/tab2menu.xsl Sun Oct  9 22:26:20 2005
@@ -0,0 +1,227 @@
+<?xml version="1.0"?>
+<!--
+  Copyright 2002-2005 The Apache Software Foundation or its licensors,
+  as applicable.
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<!--
+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
+
+-->
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+  <!-- ================================================================ -->
+  <!-- These templates SHOULD be overridden                             -->
+  <!-- ================================================================ -->
+
+  <!-- Called before first level 1 tag -->
+  <xsl:template name="pre-separator">
+  </xsl:template>
+
+  <!-- Called after last level 1 tag -->
+  <xsl:template name="post-separator">
+  </xsl:template>
+
+  <!-- Called between level 1 tags -->
+  <xsl:template name="separator">
+    <xsl:text> | </xsl:text>
+  </xsl:template>
+  
+  <!-- Called before first level 2 tag -->
+  <xsl:template name="level2-pre-separator">
+  </xsl:template>
+
+  <!-- Called after last level 2 tag -->
+  <xsl:template name="level2-post-separator">
+  </xsl:template>
+
+  <!-- Called between level 2 tags -->
+  <xsl:template name="level2-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 level 1 tab node -->
+  <xsl:template name="selected">
+    <xsl:call-template name="base-selected"/>
+  </xsl:template>
+
+  <!-- Display an unselected level 1 tab node -->
+  <xsl:template name="not-selected">
+    <xsl:call-template name="base-not-selected"/>
+  </xsl:template>
+
+  <!-- Display a selected second level tab node -->
+  <xsl:template name="level2-selected">
+    <xsl:call-template name="base-selected"/>
+  </xsl:template>
+
+  <!-- Display an unselected second level tab node -->
+  <xsl:template name="level2-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 level 1 tab, whose path is a subset of the current URL.  Ie,
+    the path of the 'current' level 1 tab.
+  -->
+  <xsl:variable name="longest-dir">
+    <xsl:call-template name="longest-dir">
+      <xsl:with-param name="tabfile" select="/"/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <!--
+    The longest path of any level 2 tab, whose path is a subset of the current URL.  Ie,
+    the path of the 'current' level 2 tab.
+  -->
+  <xsl:variable name="level2-longest-dir">
+    <xsl:call-template name="level2-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: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="." mode="level1"/>
+    </xsl:for-each>
+    <xsl:call-template name="post-separator"/>
+  </xsl:template>
+
+  <!-- Called from tabs, after it has written the outer 'div class=tabs' and
+  any other HTML -->
+  <xsl:template name="level2tabs">
+    <xsl:call-template name="level2-pre-separator"/>
+    <xsl:for-each select="tab[@dir=$longest-dir]/tab|tab[@href=$longest-dir]/tab">
+      <xsl:if test="position()!=1"><xsl:call-template name="level2-separator"/></xsl:if>
+      <xsl:apply-templates select="." mode="level2"/>
+    </xsl:for-each>
+    <xsl:call-template name="level2-post-separator"/>
+  </xsl:template>
+
+  <xsl:template match="tab" mode="level1">
+    <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>
+
+  <xsl:template match="tab" mode="level2">
+    <xsl:choose>
+      <xsl:when test="@id and @id = $matching-id">
+        <xsl:call-template name="level2-selected"/>
+      </xsl:when>
+      <xsl:when test="@dir = $level2-longest-dir">
+        <xsl:call-template name="level2-selected"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:call-template name="level2-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>

Propchange: forrest/trunk/main/webapp/skins/common/xslt/html/tab2menu.xsl
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message