home | career | drupal | java | mac | mysql | perl | scala | uml | unix  
</table> </body> </html> </xsl:template> <!-- Process a menu for the navigation bar --> <xsl:template match="menu"> <p>

<ul> <xsl:apply-templates select="item"/> </ul> </xsl:template> <!-- Process a menu item for the navigation bar --> <xsl:template match="item"> <xsl:variable name="href"> <xsl:value-of select="@href"/> </xsl:variable> <li> </xsl:template> <!-- Process a documentation section --> <xsl:template match="section"> <xsl:variable name="name"> <xsl:value-of select="@name"/> </xsl:variable> <table border="0" cellspacing="0" cellpadding="2"> <!-- Section heading --> <tr> <!-- Section body --> <tr> </table> </xsl:template> <!-- Process a documentation subsection --> <xsl:template match="subsection"> <xsl:variable name="name"> <xsl:value-of select="@name"/> </xsl:variable> <table border="0" cellspacing="0" cellpadding="2"> <!-- Subsection heading --> <tr> <!-- Subsection body --> <tr> </table> </xsl:template> <!-- Process a source code example --> <xsl:template match="source"> <xsl:variable name="void"> <xsl:value-of select="$relative-path"/> </xsl:variable> <div align="left"> <table cellspacing="4" cellpadding="0" border="0"> <tr> <td bgcolor="{$source-color}" width="1" height="1"> <img src="{$void}" width="1" height="1" vspace="0" hspace="0" border="0"/> </td> <td bgcolor="{$source-color}" height="1"> <img src="{$void}" width="1" height="1" vspace="0" hspace="0" border="0"/> </td> <td bgcolor="{$source-color}" width="1" height="1"> <img src="{$void}" width="1" height="1" vspace="0" hspace="0" border="0"/> </td> </tr> <tr> <td bgcolor="{$source-color}" width="1"> <img src="{$void}" width="1" height="1" vspace="0" hspace="0" border="0"/> </td> <td bgcolor="#ffffff" height="1">
            <xsl:value-of select="."/>
          </pre>
          <td bgcolor="{$source-color}" width="1">
            <img src="{$void}" width="1" height="1" vspace="0" hspace="0" border="0"/>
          </td>
        </tr>
        <tr>
          <td bgcolor="{$source-color}" width="1" height="1">
            <img src="{$void}" width="1" height="1" vspace="0" hspace="0" border="0"/>
          </td>
          <td bgcolor="{$source-color}" height="1">
            <img src="{$void}" width="1" height="1" vspace="0" hspace="0" border="0"/>
          </td>
          <td bgcolor="{$source-color}" width="1" height="1">
            <img src="{$void}" width="1" height="1" vspace="0" hspace="0" border="0"/>
          </td>
        </tr>
      </table>
    </div>
  </xsl:template>


  <!-- Process an attributes list with nested attribute elements -->
  <xsl:template match="attributes">
    <table border="1" cellpadding="5">
      <tr>
        <th width="15%" bgcolor="{$attributes-color}">
          <font color="#ffffff">Attribute
        </th>
        <th width="85%" bgcolor="{$attributes-color}">
          <font color="#ffffff">Description
        </th>
      </tr>
      <xsl:for-each select="attribute">
        <tr>
          <td align="left" valign="center">
            <xsl:if test="@required = 'true'">
              <strong>
            </xsl:if>
            <xsl:if test="@required != 'true'">
              <code>
            </xsl:if>
          </td>
          <td align="left" valign="center">
            <xsl:apply-templates/>
          </td>
        </tr>
      </xsl:for-each>
    </table>
  </xsl:template>

  <!-- Fix relative links in printer friendly versions of the docs -->
  <xsl:template match="a">
    <xsl:variable name="href" select="@href"/>
    <xsl:choose>
      <xsl:when test="$standalone = 'standalone'">
        <xsl:apply-templates/>
      </xsl:when>
      <xsl:when test="$project-menu != 'menu' and starts-with(@href,'../')">
        <a href="../{$href}">
      </xsl:when>
      <xsl:when test="$project-menu != 'menu' and starts-with(@href,'./') and contains(substring(@href,3),'/')">
        <a href=".{$href}">
      </xsl:when>
      <xsl:when test="$project-menu != 'menu' and not(contains(@href,'//')) and not(starts-with(@href,'/')) and not(starts-with(@href,'#')) and contains(@href,'/')">
        <a href="../{$href}">
      </xsl:when>
      <xsl:when test="$href != ''">
        <a href="{$href}">
      </xsl:when>
      <xsl:otherwise>
        <xsl:variable name="name" select="@name"/>
        <a name="{$name}">
      </xsl:otherwise>
    </xsl:choose>
  </xsl:template>

  <!-- Changelog related tags -->
  <xsl:template match="changelog">
    <table border="0" cellpadding="2" cellspacing="2">
      <xsl:apply-templates/>
    </table>
  </xsl:template>

  <xsl:template match="changelog/add">
    <tr>
      <xsl:variable name="src">/images/add.gif
      <td>add
      <td>
    </tr>
  </xsl:template>

  <xsl:template match="changelog/update">
    <tr>
      <xsl:variable name="src">/images/update.gif
      <td>update
      <td>
    </tr>
  </xsl:template>

  <xsl:template match="changelog/design">
    <tr>
      <xsl:variable name="src">/images/design.gif
      <td>design
      <td>
    </tr>
  </xsl:template>

  <xsl:template match="changelog/docs">
    <tr>
      <xsl:variable name="src">/images/docs.gif
      <td>docs
      <td>
    </tr>
  </xsl:template>

  <xsl:template match="changelog/fix">
    <tr>
      <xsl:variable name="src">/images/fix.gif
      <td>fix
      <td>
    </tr>
  </xsl:template>

  <xsl:template match="changelog/scode">
    <tr>
      <xsl:variable name="src">/images/code.gif
      <td>code
      <td>
    </tr>
  </xsl:template>

  <!-- Process an attributes list with nested attribute elements -->
  <xsl:template match="status">
    <table border="1" cellpadding="5">
      <tr>
        <th width="15%" bgcolor="{$attributes-color}">
          <font color="#ffffff">Priority
        </th>
        <th width="50%" bgcolor="{$attributes-color}">
          <font color="#ffffff">Action Item
        </th>
        <th width="25%" bgcolor="{$attributes-color}">
          <font color="#ffffff">Volunteers
        </th>
        <xsl:for-each select="item">
        <tr>
          <td align="left" valign="center">
            <xsl:value-of select="@priority"/>
          </td>
          <td align="left" valign="center">
            <xsl:apply-templates/>
          </td>
          <td align="left" valign="center">
            <xsl:value-of select="@owner"/>
          </td>
        </tr>
        </xsl:for-each>
      </tr>
    </table>
  </xsl:template>

  <!-- Link to a bug report -->
  <xsl:template match="bug">
      <xsl:variable name="link">
      <a href="{$link}">
  </xsl:template>

  <!-- Process everything else by just passing it through -->
  <xsl:template match="*|@*">
    <xsl:copy>
      <xsl:apply-templates select="@*|*|text()"/>
    </xsl:copy>
  </xsl:template>

</xsl:stylesheet>

Other Tomcat examples (source code examples)

Here is a short list of links related to this Tomcat tomcat-docs.xsl source code file:

Tomcat example source code file (tomcat-docs.xsl)

This example Tomcat source code file (tomcat-docs.xsl) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Tomcat tags/keywords

apache, apache, license, license, logo, logo, process, process, section, see, side, software, version, you

The Tomcat tomcat-docs.xsl source code

<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You 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.
-->
<!-- Content Stylesheet for "tomcat-docs" Documentation -->

<!-- $Id: tomcat-docs.xsl 562814 2007-08-05 03:52:04Z markt $ -->

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  version="1.0">


  <!-- Output method -->
  <xsl:output method="html"
            encoding="iso-8859-1"
              indent="no"/>


  <!-- Defined parameters (overrideable) -->
  <xsl:param    name="home-name"        select="'The Tomcat Project'"/>
  <xsl:param    name="home-href"        select="'http://tomcat.apache.org/'"/>
  <xsl:param    name="home-logo"        select="'/images/tomcat.gif'"/>
  <xsl:param    name="printer-logo"     select="'/images/printer.gif'"/>
  <xsl:param    name="apache-logo"      select="'/images/asf-logo.gif'"/>
  <xsl:param    name="relative-path"    select="'.'"/>
  <xsl:param    name="void-image"       select="'/images/void.gif'"/>
  <xsl:param    name="project-menu"     select="'menu'"/>
  <xsl:param    name="standalone"       select="''"/>
  <xsl:param    name="buglink"          select="'http://issues.apache.org/bugzilla/show_bug.cgi?id='"/>

  <!-- Defined variables (non-overrideable) -->
  <xsl:variable name="body-bg"          select="'#ffffff'"/>
  <xsl:variable name="body-fg"          select="'#000000'"/>
  <xsl:variable name="body-link"        select="'#525D76'"/>
  <xsl:variable name="banner-bg"        select="'#525D76'"/>
  <xsl:variable name="banner-fg"        select="'#ffffff'"/>
  <xsl:variable name="sub-banner-bg"    select="'#828DA6'"/>
  <xsl:variable name="sub-banner-fg"    select="'#ffffff'"/>
  <xsl:variable name="source-color"     select="'#023264'"/>
  <xsl:variable name="attributes-color" select="'#023264'"/>
  <xsl:variable name="table-th-bg"      select="'#039acc'"/>
  <xsl:variable name="table-td-bg"      select="'#a0ddf0'"/>

  <!-- Process an entire document into an HTML page -->
  <xsl:template match="document">
  <xsl:variable name="project"
              select="document('project.xml')/project"/>
    <html>
    <head>
    <title> - 
    <xsl:for-each select="properties/author">
      <xsl:variable name="name">
        <xsl:value-of select="."/>
      </xsl:variable>
      <xsl:variable name="email">
        <xsl:value-of select="@email"/>
      </xsl:variable>
      <meta name="author" value="{$name}"/>
      <meta name="email" value="{$email}"/>
    </xsl:for-each>
    </head>

    <body bgcolor="{$body-bg}" text="{$body-fg}" link="{$body-link}"
          alink="{$body-link}" vlink="{$body-link}">

    <table border="0" width="100%" cellspacing="0">

      <xsl:comment>PAGE HEADER
      <tr>
        <td>
        <xsl:if test="project/logo">
          <xsl:variable name="alt">
            <xsl:value-of select="project/logo"/>
          </xsl:variable>
          <xsl:variable name="home">
            <xsl:value-of select="project/@href"/>
          </xsl:variable>
          <xsl:variable name="src">
            <!--
          </xsl:variable>

          <xsl:comment>PROJECT LOGO
          <a href="{$home}">
            <img src="{$src}" align="right" alt="{$alt}" border="0"/>
          </a>
        </xsl:if>
        </td>
        <td>
          <font face="arial,helvetica,sanserif">
            <h1>
          </font>
        </td>
        <td>
          <xsl:comment>APACHE LOGO
          <xsl:variable name="src">
            <xsl:value-of select="$relative-path"/>
          </xsl:variable>
          <a href="http://www.apache.org/">
            <img src="http://tomcat.apache.org/tomcat-5.5-doc/images/asf-logo.gif" align="right" alt="Apache Logo" border="0"/>
          </a>
        </td>
      </tr>
    </table>

    <table border="0" width="100%" cellspacing="4">

      <xsl:comment>HEADER SEPARATOR
      <tr>
        <td colspan="2">
          <hr noshade="noshade" size="1"/>
        </td>
      </tr>

      <tr>

        <!-- Don't generate a menu if styling printer friendly docs -->
        <xsl:if test="$project-menu = 'menu'">
          <xsl:comment>LEFT SIDE NAVIGATION
          <td width="20%" valign="top" nowrap="true">
            <xsl:apply-templates select="project/body/menu"/>
          </td>
        </xsl:if>

        <xsl:comment>RIGHT SIDE MAIN BODY
        <td width="80%" valign="top" align="left">
          <table border="0" width="100%" cellspacing="4">
            <tr>
              <td align="left" valign="top">
                <h1>
                <h2>
              </td>
              <td align="right" valign="top" nowrap="true">
                <!-- Add the printer friendly link for docs with a menu -->
                <xsl:if test="$project-menu = 'menu'">
                  <xsl:variable name="src">
                    <xsl:value-of select="$relative-path"/>
                  </xsl:variable>
                  <xsl:variable name="url">
                    <xsl:value-of select="/document/@url"/>
                  </xsl:variable>
                  <small>
                    <a href="printer/{$url}">
                      <img src="{$src}" border="0" alt="Printer Friendly Version"/>
                      <br />print-friendly
version </a> </small> </xsl:if> <xsl:if test="$project-menu != 'menu'"> <xsl:variable name="void"> <xsl:value-of select="$relative-path"/> </xsl:variable> <img src="{$void}" width="1" height="1" vspace="0" hspace="0" border="0"/> </xsl:if> </td> </tr> </table> <xsl:apply-templates select="body/section"/> </td> </tr> <xsl:comment>FOOTER SEPARATOR <tr> <td colspan="2"> <hr noshade="noshade" size="1"/> </td> </tr> <xsl:comment>PAGE FOOTER <tr>
<div align="center"> Copyright © 1999-2006, Apache Software Foundation </em> </td>
<font color="{$banner-fg}" face="arial,helvetica.sanserif"> <a name="{$name}"> <strong> </td>
<xsl:apply-templates/> </blockquote>
<font color="{$sub-banner-fg}" face="arial,helvetica.sanserif"> <a name="{$name}"> <strong> </td>
<xsl:apply-templates/> </blockquote>


my book on functional programming

 

new blog posts

 

Copyright 1998-2019 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.