1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451
|
<?xml version="1.0" encoding="UTF-8"?>
<!--
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 -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="3.0">
<!-- Output method -->
<xsl:output method="html"
html-version="5.0"
encoding="UTF-8"
indent="no"
doctype-system="about:legacy-compat"/>
<!-- Defined parameters (overridable) -->
<xsl:param name="home-logo" select="'/images/tomcat.png'"/>
<xsl:param name="home-stylesheet" select="'/images/docs-stylesheet.css'"/>
<xsl:param name="apache-logo" select="'/images/asf-logo.svg'"/>
<xsl:param name="subdir" select="''"/>
<xsl:param name="relative-path" select="'.'"/>
<!-- Keep versions in sync with build.xml -->
<xsl:param name="version" select="'11.0.x'"/>
<xsl:param name="majorversion" select="'11'"/>
<xsl:param name="majorminorversion" select="'11.0'"/>
<xsl:param name="minjavaversion" select="'17'"/>
<xsl:param name="buildjavaversion" select="'22'"/>
<xsl:param name="antversionrequired" select="'1.10.2'"/>
<xsl:param name="build-date" select="'MMM d yyyy'"/>
<xsl:param name="build-date-iso-8601" select="'yyyy-MM-dd'"/>
<xsl:param name="year" select="'yyyy'"/>
<xsl:param name="buglink" select="'https://bz.apache.org/bugzilla/show_bug.cgi?id='"/>
<xsl:param name="prlink" select="'https://github.com/apache/tomcat/pull/'"/>
<xsl:param name="revlink" select="'https://svn.apache.org/viewvc?view=rev&rev='"/>
<xsl:param name="doclink" select="'https://tomcat.apache.org/tomcat-11.0-doc'"/>
<xsl:param name="sylink" select="'https://tomcat.apache.org/security-11.html'"/>
<xsl:param name="dllink" select="'https://tomcat.apache.org/download-11.cgi'"/>
<xsl:param name="sitedir" select="''"/>
<xsl:param name="filename" select="'-'"/>
<!-- Defined variables (non-overridable) -->
<xsl:variable name="project-xml-filename"><xsl:value-of select="$subdir"/>project.xml</xsl:variable>
<xsl:variable name="project"
select="document($project-xml-filename)/project"/>
<!-- Process an entire document into an HTML page -->
<xsl:template match="document">
<html lang="en">
<head>
<!-- Note: XSLT seems to always output a
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
when method="html",
therefore we can't use
<meta charset="UTF-8"/>.
In XHTML, this is not needed as the encoding will be
specified in the XML declaration.
-->
<xsl:variable name="css-src">
<xsl:value-of select="$relative-path"/><xsl:value-of select="$home-stylesheet"/>
</xsl:variable>
<link href="{$css-src}" rel="stylesheet" type="text/css"/>
<title><xsl:value-of select="$project/title"/> (<xsl:value-of select="$version"/>) - <xsl:value-of select="properties/title"/></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" content="{$name}"/>
</xsl:for-each>
</head>
<body>
<div id="wrapper">
<!-- Header -->
<header>
<div id="header">
<div>
<div>
<xsl:if test="$project/logo">
<xsl:variable name="src">
<xsl:value-of select="$relative-path"/><xsl:value-of select="$home-logo"/>
</xsl:variable>
<div class="logo noPrint">
<a href="{$project/@href}"><img alt="Tomcat Home" src="{$src}"/></a>
</div>
</xsl:if>
<div style="height: 1px;"/>
<xsl:variable name="src">
<xsl:value-of select="$relative-path"/><xsl:value-of select="$apache-logo"/>
</xsl:variable>
<div class="asfLogo noPrint">
<a href="https://www.apache.org/" target="_blank"><img src="{$src}" alt="The Apache Software Foundation" style="width: 266px; height: 83px;"/></a>
</div>
<h1><xsl:value-of select="$project/title"/></h1>
<div class="versionInfo">
Version <xsl:value-of select="$version"/>,
<time datetime="{$build-date-iso-8601}"><xsl:value-of select="$build-date"/></time>
</div>
<div style="height: 1px;"/>
<div style="clear: left;"/>
</div>
</div>
</div>
</header>
<div id="middle">
<div>
<div id="mainLeft" class="noprint">
<div>
<!-- Navigation -->
<nav>
<xsl:apply-templates select="$project/body/menu"/>
</nav>
</div>
</div>
<div id="mainRight">
<div id="content">
<!-- Main Part -->
<h2><xsl:value-of select="properties/title"/></h2>
<xsl:apply-templates select="body/section"/>
</div>
</div>
</div>
</div>
<!-- Footer -->
<footer>
<div id="footer">
Copyright © 1999-<xsl:value-of select="$year"/>, The Apache Software Foundation
<br/>
Apache Tomcat, Tomcat, Apache, the Apache Tomcat logo and the Apache logo
are either registered trademarks or trademarks of the Apache Software
Foundation.
</div>
</footer>
</div>
</body>
</html>
</xsl:template>
<!-- Process a menu for the navigation bar -->
<xsl:template match="menu">
<div>
<h2><xsl:value-of select="@name"/></h2>
<ul>
<xsl:apply-templates select="item"/>
</ul>
</div>
</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><a href="{$href}"><xsl:value-of select="@name"/></a></li>
</xsl:template>
<!-- Process a documentation section -->
<xsl:template match="section">
<xsl:variable name="name2">
<xsl:choose>
<xsl:when test="@anchor">
<xsl:value-of select="@anchor" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="@name"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="name">
<xsl:value-of select="translate($name2, ' #', '__')"/>
</xsl:variable>
<!-- Section heading -->
<h3 id="{$name}">
<xsl:if test="@rtext">
<!-- Additional right-aligned text cell in section heading. It is used by changelog.xml -->
<span style="float: right;">
<xsl:value-of select="@rtext"/>
</span><xsl:text> </xsl:text> <!-- Ensure a space follows after </span> -->
</xsl:if>
<xsl:value-of select="@name"/>
</h3>
<!-- Section body -->
<div class="text">
<xsl:apply-templates/>
</div>
</xsl:template>
<!-- Process a documentation subsection -->
<xsl:template match="subsection">
<xsl:variable name="name2">
<xsl:choose>
<xsl:when test="@anchor">
<xsl:value-of select="@anchor" />
</xsl:when>
<xsl:otherwise>
<xsl:if test="
count(//*[self::section or self::subsection][@name=current()/@name]) > 1">
<xsl:value-of select="concat(parent::*[self::section or self::subsection]/@name, '/')"/>
</xsl:if>
<xsl:value-of select="@name"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="name">
<xsl:value-of select="translate($name2, ' #', '__')"/>
</xsl:variable>
<div class="subsection">
<!-- Subsection heading -->
<!-- TODO: When a <subsection> is nested in another <subsection>,
the output should be <h5>, not <h4>. Same with <h6>. -->
<h4 id="{$name}">
<xsl:value-of select="@name"/>
</h4>
<!-- Subsection body -->
<div class="text">
<xsl:apply-templates/>
</div>
</div>
</xsl:template>
<!-- Generate table of contents -->
<xsl:template match="toc">
<ul><xsl:apply-templates mode="toc" select="following::section"/></ul>
</xsl:template>
<xsl:template mode="toc" match="section|subsection">
<xsl:variable name="name2">
<xsl:choose>
<xsl:when test="@anchor">
<xsl:value-of select="@anchor" />
</xsl:when>
<xsl:otherwise>
<xsl:if test="local-name()='subsection' and
count(//*[self::section or self::subsection][@name=current()/@name]) > 1">
<xsl:value-of select="concat(parent::*[self::section or self::subsection]/@name, '/')"/>
</xsl:if>
<xsl:value-of select="@name"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="name">
<xsl:value-of select="translate($name2, ' #', '__')"/>
</xsl:variable>
<li><a href="#{$name}"><xsl:value-of select="@name"/></a>
<xsl:if test="subsection">
<ol><xsl:apply-templates mode="toc" select="subsection"/></ol>
</xsl:if>
</li>
</xsl:template>
<!-- Process a source code example -->
<xsl:template match="source">
<div class="codeBox">
<pre>
<xsl:if test="@wrapped='true'">
<xsl:attribute name="class">wrap</xsl:attribute>
</xsl:if>
<code><xsl:apply-templates/></code>
</pre>
</div>
</xsl:template>
<!-- Process an attributes list with nested attribute elements -->
<xsl:template match="attributes">
<table class="defaultTable">
<tr>
<th style="width: 15%;">
Attribute
</th>
<th style="width: 85%;">
Description
</th>
</tr>
<xsl:for-each select="attribute">
<tr id="{concat(../../../@name, '_', ../../@name, '_', @name)}">
<td>
<xsl:if test="@required = 'true'">
<strong><code class="attributeName"><xsl:value-of select="@name"/></code></strong>
</xsl:if>
<xsl:if test="@required != 'true'">
<code class="attributeName"><xsl:value-of select="@name"/></code>
</xsl:if>
</td>
<td>
<xsl:apply-templates/>
</td>
</tr>
</xsl:for-each>
</table>
</xsl:template>
<!-- Process a properties list with nested property elements -->
<xsl:template match="properties">
<table class="defaultTable">
<tr>
<th style="width: 15%;">
Property
</th>
<th style="width: 85%;">
Description
</th>
</tr>
<xsl:for-each select="property">
<tr>
<td>
<code class="propertyName"><xsl:value-of select="@name"/></code>
</td>
<td>
<xsl:apply-templates/>
</td>
</tr>
</xsl:for-each>
</table>
</xsl:template>
<!-- Changelog related tags -->
<xsl:template match="changelog">
<ul class="changelog">
<xsl:apply-templates/>
</ul>
</xsl:template>
<xsl:template match="changelog/add">
<xsl:variable name="src"><xsl:value-of select="$relative-path"/>/images/add.gif</xsl:variable>
<li>
<img alt="Add: " class="icon" src="{$src}"/><xsl:apply-templates/>
</li>
</xsl:template>
<xsl:template match="changelog/update">
<xsl:variable name="src"><xsl:value-of select="$relative-path"/>/images/update.gif</xsl:variable>
<li>
<img alt="Update: " class="icon" src="{$src}"/><xsl:apply-templates/>
</li>
</xsl:template>
<xsl:template match="changelog/design">
<xsl:variable name="src"><xsl:value-of select="$relative-path"/>/images/design.gif</xsl:variable>
<li>
<img alt="Design: " class="icon" src="{$src}"/><xsl:apply-templates/>
</li>
</xsl:template>
<xsl:template match="changelog/docs">
<xsl:variable name="src"><xsl:value-of select="$relative-path"/>/images/docs.gif</xsl:variable>
<li>
<img alt="Docs: " class="icon" src="{$src}"/><xsl:apply-templates/>
</li>
</xsl:template>
<xsl:template match="changelog/fix">
<xsl:variable name="src"><xsl:value-of select="$relative-path"/>/images/fix.gif</xsl:variable>
<li>
<img alt="Fix: " class="icon" src="{$src}"/><xsl:apply-templates/>
</li>
</xsl:template>
<xsl:template match="changelog/scode">
<xsl:variable name="src"><xsl:value-of select="$relative-path"/>/images/code.gif</xsl:variable>
<li>
<img alt="Code: " class="icon" src="{$src}"/><xsl:apply-templates/>
</li>
</xsl:template>
<!-- Link to a bug report -->
<xsl:template match="bug">
<xsl:variable name="link"><xsl:value-of select="$buglink"/><xsl:value-of select="text()"/></xsl:variable>
<a href="{$link}"><xsl:apply-templates/></a>
</xsl:template>
<!-- Link to a pull request -->
<xsl:template match="pr">
<xsl:variable name="link"><xsl:value-of select="$prlink"/><xsl:value-of select="text()"/></xsl:variable>
<a href="{$link}">#<xsl:apply-templates/></a>
</xsl:template>
<!-- Link to a SVN revision report -->
<xsl:template match="rev">
<xsl:variable name="link"><xsl:value-of select="$revlink"/><xsl:value-of select="text()"/></xsl:variable>
<a href="{$link}">r<xsl:apply-templates/></a>
</xsl:template>
<!-- Link to online docs -->
<xsl:template match="doc">
<xsl:variable name="link"><xsl:value-of select="$doclink"/><xsl:value-of select="@path"/></xsl:variable>
<a href="{$link}"><xsl:apply-templates/></a>
</xsl:template>
<!-- Link to security page -->
<xsl:template match="security">
<xsl:variable name="link"><xsl:value-of select="$sylink"/></xsl:variable>
<a href="{$link}"><xsl:apply-templates/></a>
</xsl:template>
<!-- Link to download page -->
<xsl:template match="download">
<xsl:variable name="link"><xsl:value-of select="$dllink"/></xsl:variable>
<a href="{$link}"><xsl:apply-templates/></a>
</xsl:template>
<!-- Version numbers -->
<xsl:template match="version-major-minor">
<xsl:value-of select="$majorminorversion"/>
</xsl:template>
<xsl:template match="version-major">
<xsl:value-of select="$majorversion"/>
</xsl:template>
<xsl:template match="min-java-version">
<xsl:value-of select="$minjavaversion"/>
</xsl:template>
<xsl:template match="build-java-version">
<xsl:value-of select="$buildjavaversion"/>
</xsl:template>
<xsl:template match="ant-version-required">
<xsl:value-of select="$antversionrequired"/>
</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>
|