common.xsl revision 4930be147adf9e3f6d3ca9313a6524f9bf654b2d
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess<?xml version="1.0"?>
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess
fd9abdda70912b99b24e3bf1a38f26fde908a74cnd<!--
fd9abdda70912b99b24e3bf1a38f26fde908a74cnd Licensed to the Apache Software Foundation (ASF) under one or more
fd9abdda70912b99b24e3bf1a38f26fde908a74cnd contributor license agreements. See the NOTICE file distributed with
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess this work for additional information regarding copyright ownership.
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess The ASF licenses this file to You under the Apache License, Version 2.0
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess (the "License"); you may not use this file except in compliance with
5a58787efeb02a1c3f06569d019ad81fd2efa06end the License. You may obtain a copy of the License at
96ad5d81ee4a2cc66a4ae19893efc8aa6d06fae7jailletc
5a58787efeb02a1c3f06569d019ad81fd2efa06end http://www.apache.org/licenses/LICENSE-2.0
5a58787efeb02a1c3f06569d019ad81fd2efa06end
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen Unless required by applicable law or agreed to in writing, software
2e545ce2450a9953665f701bb05350f0d3f26275nd distributed under the License is distributed on an "AS IS" BASIS,
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen See the License for the specific language governing permissions and
5a58787efeb02a1c3f06569d019ad81fd2efa06end limitations under the License.
00c2cccc28f249fb3b968ddf3e05508595290d40nd-->
af33a4994ae2ff15bc67d19ff1a7feb906745bf8rbowen
3f08db06526d6901aa08c110b5bc7dde6bc39905nd<!DOCTYPE xsl:stylesheet [
5a58787efeb02a1c3f06569d019ad81fd2efa06end <!ENTITY nbsp SYSTEM "util/nbsp.xml">
5a58787efeb02a1c3f06569d019ad81fd2efa06end <!ENTITY lf SYSTEM "util/lf.xml">
5a58787efeb02a1c3f06569d019ad81fd2efa06end]>
3f08db06526d6901aa08c110b5bc7dde6bc39905nd<xsl:stylesheet version="1.0"
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
ad74a0524a06bfe11b7de9e3b4ce7233ab3bd3f7nd xmlns="http://www.w3.org/1999/xhtml">
d05d0eb4ae6d2a5e513fc3bf2555ce33da416634nd
7f5b59ccc63c0c0e3e678a168f09ee6a2f51f9d0nd<!-- -->
4b3a8afbfcea8b265d179a122bf40dfedd1ce280takashi<!-- Please, don't hard-code output strings! Use the language -->
f086b4b402fa9a2fefc7dda85de2a3cc1cd0a654rjung<!-- files and the translation "stuff"... -->
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd<!-- -->
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd
2eaf662cbc81e823e8d9aeb8d54e69e63032493erbowen<!-- Injected variables: -->
2eaf662cbc81e823e8d9aeb8d54e69e63032493erbowen<!-- $is-chm - (boolean) target is for CHM generation or not -->
2eaf662cbc81e823e8d9aeb8d54e69e63032493erbowen<!-- $is-zip - (boolean) target is for ZIP generation or not -->
3794498bc788e827c8a73617daba78e06cc7e9e9rbowen<!-- $message - (node-set) localized common text snippets -->
2eaf662cbc81e823e8d9aeb8d54e69e63032493erbowen<!-- $doclang - (string) document language -->
2eaf662cbc81e823e8d9aeb8d54e69e63032493erbowen<!-- $output-encoding - (string) MIME charset name of the output -->
2eaf662cbc81e823e8d9aeb8d54e69e63032493erbowen<!-- encoding -->
2eaf662cbc81e823e8d9aeb8d54e69e63032493erbowen
2eaf662cbc81e823e8d9aeb8d54e69e63032493erbowen<!-- Constants used for case translation -->
2eaf662cbc81e823e8d9aeb8d54e69e63032493erbowen<xsl:variable name="lowercase" select="'abcdefghijklmnopqrstuvwxyz'" />
2eaf662cbc81e823e8d9aeb8d54e69e63032493erbowen<xsl:variable name="uppercase" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'" />
2eaf662cbc81e823e8d9aeb8d54e69e63032493erbowen
2eaf662cbc81e823e8d9aeb8d54e69e63032493erbowen<!-- space separated list of blockelements defined in common.dtd -->
2eaf662cbc81e823e8d9aeb8d54e69e63032493erbowen<!-- used for inline content catching in <example>s -->
2eaf662cbc81e823e8d9aeb8d54e69e63032493erbowen<xsl:variable name="blockelements">
3794498bc788e827c8a73617daba78e06cc7e9e9rbowen p example note table ul ol dl pre img blockquote
3794498bc788e827c8a73617daba78e06cc7e9e9rbowen</xsl:variable>
2eaf662cbc81e823e8d9aeb8d54e69e63032493erbowen
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess<!-- relative path to /manual/ -->
3794498bc788e827c8a73617daba78e06cc7e9e9rbowen<xsl:variable name="metafile" select="document(/*/@metafile)/metafile" />
2eaf662cbc81e823e8d9aeb8d54e69e63032493erbowen<xsl:variable name="path" select="$metafile/relpath" />
2eaf662cbc81e823e8d9aeb8d54e69e63032493erbowen
2eaf662cbc81e823e8d9aeb8d54e69e63032493erbowen<!-- load outsourced page types -->
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf<xsl:include href="moduleindex.xsl" />
2eaf662cbc81e823e8d9aeb8d54e69e63032493erbowen<xsl:include href="directiveindex.xsl" />
2eaf662cbc81e823e8d9aeb8d54e69e63032493erbowen<xsl:include href="manualpage.xsl" />
2eaf662cbc81e823e8d9aeb8d54e69e63032493erbowen<xsl:include href="synopsis.xsl" />
2eaf662cbc81e823e8d9aeb8d54e69e63032493erbowen<xsl:include href="sitemap.xsl" />
2994e5db825beca08d968db3493849d0a211c33aerikabele<xsl:include href="indexpage.xsl" />
5ae30adbe59946de742ab0cd6be3b7457471a698takashi<xsl:include href="quickreference.xsl" />
2eaf662cbc81e823e8d9aeb8d54e69e63032493erbowen<xsl:include href="faq.xsl" />
2eaf662cbc81e823e8d9aeb8d54e69e63032493erbowen
2eaf662cbc81e823e8d9aeb8d54e69e63032493erbowen<!-- load utility snippets -->
ca0d928ec8e2519c9ef548469de80d80efd0fdband<xsl:include href="util/modtrans.xsl" />
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess
3794498bc788e827c8a73617daba78e06cc7e9e9rbowen<!-- make sure, we set relative anchors only, if we're actually -->
2eaf662cbc81e823e8d9aeb8d54e69e63032493erbowen<!-- transforming a modulefile (see <directive> template) -->
2eaf662cbc81e823e8d9aeb8d54e69e63032493erbowen<xsl:variable name="in-modulesynopsis" select="boolean(/modulesynopsis)" />
2eaf662cbc81e823e8d9aeb8d54e69e63032493erbowen
2eaf662cbc81e823e8d9aeb8d54e69e63032493erbowen<!-- when referencing to a directory, we may need to complete the path -->
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess<!-- with the index file (for offline applications like *.chm files) -->
2eaf662cbc81e823e8d9aeb8d54e69e63032493erbowen<xsl:variable name="index-file">
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess <xsl:if test="$is-chm or $is-zip">index.html</xsl:if>
2eaf662cbc81e823e8d9aeb8d54e69e63032493erbowen</xsl:variable>
2eaf662cbc81e823e8d9aeb8d54e69e63032493erbowen
2eaf662cbc81e823e8d9aeb8d54e69e63032493erbowen<!-- it may be desired to open external targets in a new window -->
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess<xsl:variable name="ext-target" select="boolean($is-chm)" />
2eaf662cbc81e823e8d9aeb8d54e69e63032493erbowen
2eaf662cbc81e823e8d9aeb8d54e69e63032493erbowen<!-- #################################################################### -->
2eaf662cbc81e823e8d9aeb8d54e69e63032493erbowen<!-- Utility templates for constructing pages -->
5a58787efeb02a1c3f06569d019ad81fd2efa06end<!-- #################################################################### -->
5a58787efeb02a1c3f06569d019ad81fd2efa06end
5a58787efeb02a1c3f06569d019ad81fd2efa06end<!-- ==================================================================== -->
5a58787efeb02a1c3f06569d019ad81fd2efa06end<!-- HTML head -->
3794498bc788e827c8a73617daba78e06cc7e9e9rbowen<!-- ==================================================================== -->
3794498bc788e827c8a73617daba78e06cc7e9e9rbowen<xsl:template name="head">
3794498bc788e827c8a73617daba78e06cc7e9e9rbowen<head>
3794498bc788e827c8a73617daba78e06cc7e9e9rbowen <!-- the meta element is necessary for offline handling like CHM -->
3794498bc788e827c8a73617daba78e06cc7e9e9rbowen <xsl:choose>
3794498bc788e827c8a73617daba78e06cc7e9e9rbowen <xsl:when test="$is-chm or $is-zip">
3794498bc788e827c8a73617daba78e06cc7e9e9rbowen <meta http-equiv="Content-Type"
b244bbf442a0aea3dc397b4d0d751f4716c5891dnd content="text/html; charset={$output-encoding}" />
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess </xsl:when>
3794498bc788e827c8a73617daba78e06cc7e9e9rbowen <xsl:otherwise>
3794498bc788e827c8a73617daba78e06cc7e9e9rbowen <xsl:comment>
3794498bc788e827c8a73617daba78e06cc7e9e9rbowen &lf;
4aa603e6448b99f9371397d439795c91a93637eand <xsl:text> </xsl:text>
aaed4ebc116f5862aff2610a809a9a9e9a28f50ecoar <xsl:text>XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</xsl:text>
c3c006c28c5b03892ccaef6e4d2cbb15a13a2072rbowen <xsl:text>XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</xsl:text>
3794498bc788e827c8a73617daba78e06cc7e9e9rbowen &lf;
3794498bc788e827c8a73617daba78e06cc7e9e9rbowen <xsl:text> </xsl:text>
3794498bc788e827c8a73617daba78e06cc7e9e9rbowen <xsl:text>This file is generated from xml source: </xsl:text>
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess <xsl:text>DO NOT EDIT</xsl:text>
b244bbf442a0aea3dc397b4d0d751f4716c5891dnd &lf;
3794498bc788e827c8a73617daba78e06cc7e9e9rbowen <xsl:text> </xsl:text>
3794498bc788e827c8a73617daba78e06cc7e9e9rbowen <xsl:text>XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</xsl:text>
3794498bc788e827c8a73617daba78e06cc7e9e9rbowen <xsl:text>XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</xsl:text>
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess &lf;
4be09dda53f10f70497dae3b597e84c24f8c2ac4rbowen <xsl:text> </xsl:text>
e884f58207082fa2136d5fc86635c31252338948erikabele </xsl:comment>
4be09dda53f10f70497dae3b597e84c24f8c2ac4rbowen </xsl:otherwise>
4be09dda53f10f70497dae3b597e84c24f8c2ac4rbowen </xsl:choose>&lf;
4be09dda53f10f70497dae3b597e84c24f8c2ac4rbowen
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess <title>
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess <xsl:choose>
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess <xsl:when test="name">
3794498bc788e827c8a73617daba78e06cc7e9e9rbowen <xsl:value-of select="name"/>
3794498bc788e827c8a73617daba78e06cc7e9e9rbowen </xsl:when>
3794498bc788e827c8a73617daba78e06cc7e9e9rbowen
4be09dda53f10f70497dae3b597e84c24f8c2ac4rbowen <xsl:otherwise>
3794498bc788e827c8a73617daba78e06cc7e9e9rbowen <xsl:value-of select="title"/>
5a58787efeb02a1c3f06569d019ad81fd2efa06end </xsl:otherwise>
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd </xsl:choose>
ad74a0524a06bfe11b7de9e3b4ce7233ab3bd3f7nd
d05d0eb4ae6d2a5e513fc3bf2555ce33da416634nd <xsl:text> </xsl:text>
7f5b59ccc63c0c0e3e678a168f09ee6a2f51f9d0nd <xsl:value-of select="normalize-space($message[@id='apachetitle'])"/>
4b3a8afbfcea8b265d179a122bf40dfedd1ce280takashi </title>&lf;
f086b4b402fa9a2fefc7dda85de2a3cc1cd0a654rjung
727872d18412fc021f03969b8641810d8896820bhumbedooh <!-- chm files get a slightly different stylesheet -->
0d0ba3a410038e179b695446bb149cce6264e0abnd <xsl:choose>
727872d18412fc021f03969b8641810d8896820bhumbedooh <xsl:when test="$is-chm">
cc7e1025de9ac63bd4db6fe7f71c158b2cf09fe4humbedooh <link type="text/css" rel="stylesheet" media="all"
0d0ba3a410038e179b695446bb149cce6264e0abnd href="{$path}/style/css/manual-chm.css" />
cc7e1025de9ac63bd4db6fe7f71c158b2cf09fe4humbedooh </xsl:when>
727872d18412fc021f03969b8641810d8896820bhumbedooh <!-- zip packages do also -->
0d0ba3a410038e179b695446bb149cce6264e0abnd <xsl:when test="$is-zip">
0d0ba3a410038e179b695446bb149cce6264e0abnd <link title="Main stylesheet" type="text/css" media="all"
0d0ba3a410038e179b695446bb149cce6264e0abnd rel="stylesheet"
ac082aefa89416cbdc9a1836eaf3bed9698201c8humbedooh href="{$path}/style/css/manual-zip.css" />&lf;
0d0ba3a410038e179b695446bb149cce6264e0abnd <link title="No Sidebar - Default font size" type="text/css" media="all"
0d0ba3a410038e179b695446bb149cce6264e0abnd rel="alternate stylesheet"
0d0ba3a410038e179b695446bb149cce6264e0abnd href="{$path}/style/css/manual-zip-100pc.css"/>
727872d18412fc021f03969b8641810d8896820bhumbedooh </xsl:when>
0d0ba3a410038e179b695446bb149cce6264e0abnd <xsl:otherwise>
0d0ba3a410038e179b695446bb149cce6264e0abnd <link title="Main stylesheet" type="text/css" media="all"
30471a4650391f57975f60bbb6e4a90be7b284bfhumbedooh rel="stylesheet"
205f749042ed530040a4f0080dbcb47ceae8a374rjung href="{$path}/style/css/manual.css" />&lf;
af33a4994ae2ff15bc67d19ff1a7feb906745bf8rbowen <link title="No Sidebar - Default font size" type="text/css" media="all"
0d0ba3a410038e179b695446bb149cce6264e0abnd rel="alternate stylesheet"
7fec19672a491661b2fe4b29f685bc7f4efa64d4nd href="{$path}/style/css/manual-loose-100pc.css"/>
7fec19672a491661b2fe4b29f685bc7f4efa64d4nd </xsl:otherwise>
7fec19672a491661b2fe4b29f685bc7f4efa64d4nd </xsl:choose>&lf;
5a58787efeb02a1c3f06569d019ad81fd2efa06end
<link type="text/css" media="print"
rel="stylesheet"
href="{$path}/style/css/manual-print.css"/>
<!-- chm files do not need a favicon -->
<xsl:if test="not($is-chm or $is-zip)">&lf;
<link rel="shortcut icon" href="{$path}/images/favicon.ico" />
</xsl:if>
</head>
</xsl:template>
<!-- /head -->
<!-- ==================================================================== -->
<!-- page top -->
<!-- ==================================================================== -->
<xsl:template name="top">
<div id="page-header">&lf;
<xsl:call-template name="super-menu" />&lf;
<p class="apache">
<xsl:value-of select="normalize-space($message
[@id='apachehttpserver'])"/>
</p>&lf;
<img src="{$path}/images/feather.gif" alt="" />
</div>&lf; <!-- /page-header -->
<div class="up">
<a href="./{$index-file}">
<xsl:if test="parentdocument">
<xsl:attribute name="href">
<xsl:value-of select="parentdocument/@href"/>
</xsl:attribute>
<xsl:call-template name="helper.uri.fix">
<xsl:with-param name="uri" select="parentdocument/@href" />
</xsl:call-template>
</xsl:if>
<img src="{$path}/images/left.gif" alt="&lt;-" title="&lt;-" />
</a>
</div>&lf;
<div id="path">&lf;
<a href="http://www.apache.org/">
<xsl:if test="$ext-target">
<xsl:attribute name="target">_blank</xsl:attribute>
</xsl:if>
<xsl:value-of select="$message[@id='apache']" />
</a>
<xsl:text> &gt; </xsl:text>
<a href="http://httpd.apache.org/">
<xsl:if test="$ext-target">
<xsl:attribute name="target">_blank</xsl:attribute>
</xsl:if>
<xsl:value-of select="$message[@id='http-server']" />
</a>
<xsl:text> &gt; </xsl:text>
<a href="http://httpd.apache.org/docs/">
<xsl:if test="$ext-target">
<xsl:attribute name="target">_blank</xsl:attribute>
</xsl:if>
<xsl:value-of select="$message[@id='documentation']" />
</a>
<xsl:if test="not(/indexpage)">
<xsl:text> &gt; </xsl:text>
<a href="{$path}/{$index-file}">
<xsl:value-of select="$message[@id='version']"/>
</a>
</xsl:if>
<xsl:if test="/modulesynopsis or /directiveindex or /quickreference">
<xsl:text> &gt; </xsl:text>
<a href="./{$index-file}">
<xsl:value-of select="$message[@id='modules']"/>
</a>
</xsl:if>
<xsl:if test="parentdocument/text()">
<xsl:text> &gt; </xsl:text>
<a href="{parentdocument/@href}">
<xsl:call-template name="helper.uri.fix">
<xsl:with-param name="uri" select="parentdocument/@href"/>
</xsl:call-template>
<xsl:value-of select="parentdocument"/>
</a>
</xsl:if>
</div> <!-- /path -->
</xsl:template>
<!-- /top -->
<!-- ==================================================================== -->
<!-- out of date -->
<!-- ==================================================================== -->
<xsl:template name="outofdate">
<xsl:if test="$metafile/variants/variant[.=$doclang]/@outdated = 'yes'">
&lf;
<div class="outofdate">
<xsl:value-of select="$message[@id='outofdate']"/>
</div>
</xsl:if>
</xsl:template>
<!-- ==================================================================== -->
<!-- page bottom -->
<!-- ==================================================================== -->
<xsl:template name="bottom">
<xsl:call-template name="langavail">
<xsl:with-param name="position" select="'bottom'" />
</xsl:call-template>
<div id="footer">&lf;
<p class="apache">
<xsl:text>Copyright 2008 The Apache Software Foundation.</xsl:text><br />
<xsl:if test="normalize-space($message[@id='before-license'])">
<xsl:value-of select="$message[@id='before-license']"/>
<xsl:text> </xsl:text>
</xsl:if>
<a href="http://www.apache.org/licenses/LICENSE-2.0">
<xsl:if test="$ext-target">
<xsl:attribute name="target">_blank</xsl:attribute>
</xsl:if>
<xsl:text>Apache License, Version 2.0</xsl:text>
</a>
<xsl:if test="normalize-space($message[@id='after-license'])">
<xsl:text> </xsl:text>
<xsl:value-of select="$message[@id='after-license']"/>
</xsl:if>
<xsl:text>.</xsl:text>
</p>&lf;
<xsl:call-template name="super-menu"/>
</div> <!-- /footer -->
</xsl:template>
<!-- /bottom -->
<!-- ==================================================================== -->
<!-- build an "available languages" section -->
<!-- ==================================================================== -->
<xsl:template name="langavail">
<xsl:param name="position" select="'top'" />
<xsl:if test="not($is-chm or $is-zip)">
<div class="{$position}lang">&lf;
<p>
<span>
<xsl:value-of select="$message[@id='langavail']" />
<xsl:text>: </xsl:text>
</span>
<xsl:for-each select="$metafile/variants/variant">
<xsl:sort select="." />
<a href="{$path}/{.}{$metafile/path}{$metafile/basename}.html">
<xsl:if test="$metafile/basename = 'index'">
<xsl:attribute name="href">
<xsl:value-of
select="concat($path, '/', ., $metafile/path)" />
</xsl:attribute>
</xsl:if>
<xsl:if test="$doclang != .">
<xsl:attribute name="hreflang">
<xsl:value-of select="." />
</xsl:attribute>
<xsl:attribute name="rel">alternate</xsl:attribute>
</xsl:if>
<xsl:attribute name="title">
<xsl:value-of select="document(concat('/lang/', .,
'.xml'))
/language/messages/message
[@id='nativename']" />
</xsl:attribute>
&nbsp;
<xsl:value-of select="." />
&nbsp;
</a>
<xsl:if test="position() != last()">
<xsl:text> |&#xA;</xsl:text>
</xsl:if>
</xsl:for-each>
</p>&lf;
</div> <!-- /.{$position}lang -->
</xsl:if>
<xsl:if test="$position = 'top'">
<xsl:call-template name="outofdate" />
</xsl:if>
</xsl:template>
<!-- /langavail -->
<!-- ==================================================================== -->
<!-- Process a documentation section -->
<!-- ==================================================================== -->
<xsl:template match="section">
<xsl:call-template name="toplink" />&lf;
<div class="section">&lf;
<!-- Section heading -->
<h2>
<xsl:choose>
<xsl:when test="@id">
<a id="{@id}" name="{@id}">
<xsl:apply-templates select="title" mode="print" />
</a>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="title" mode="print" />
</xsl:otherwise>
</xsl:choose>
</h2>
<!-- Section body -->
<xsl:apply-templates />
</div> <!-- /.section -->
</xsl:template>
<!-- /section -->
<!-- ==================================================================== -->
<!-- handle subsections (lower level headings) -->
<!-- ==================================================================== -->
<xsl:template match="section/section">
<!-- Section heading -->
<h3>
<xsl:choose>
<xsl:when test="@id">
<a id="{@id}" name="{@id}">
<xsl:apply-templates select="title" mode="print" />
</a>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="title" mode="print" />
</xsl:otherwise>
</xsl:choose>
</h3>
<!-- Section body -->
<xsl:apply-templates />
</xsl:template>
<!-- /section/section -->
<!-- ==================================================================== -->
<!-- handle subsubsections (h4) -->
<!-- ==================================================================== -->
<xsl:template match="section/section/section">
<!-- Section heading -->
<h4>
<xsl:choose>
<xsl:when test="@id">
<a id="{@id}" name="{@id}">
<xsl:apply-templates select="title" mode="print" />
</a>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="title" mode="print" />
</xsl:otherwise>
</xsl:choose>
</h4>
<!-- Section body -->
<xsl:apply-templates/>
</xsl:template>
<!-- /section/section/section -->
<!-- ==================================================================== -->
<!-- section nesting > h4 is not supported for now -->
<!-- ==================================================================== -->
<xsl:template match="section/section/section/section">
<xsl:message terminate="yes">
<xsl:text>FATAL: exceeding maximum section nesting level.</xsl:text>
&lf;&lf;
<xsl:text>Perhaps you should consider to split your document into</xsl:text>
&lf;
<xsl:text>several ones...</xsl:text>
&lf;
</xsl:message>
</xsl:template>
<!-- /section/section/section/section -->
<!-- ==================================================================== -->
<!-- (sub)section titles -->
<!-- ==================================================================== -->
<xsl:template match="section/title" mode="print">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="section/title" />
<!-- /section/title -->
<!-- ==================================================================== -->
<!-- generate section index -->
<!-- ==================================================================== -->
<xsl:template match="section" mode="index">
<li>
<img src="{$path}/images/down.gif" alt="" />
<xsl:text> </xsl:text>
<xsl:choose>
<xsl:when test="@id">
<a href="#{@id}">
<xsl:apply-templates select="title" mode="print" />
</a>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="title" mode="print" />
</xsl:otherwise>
</xsl:choose>
</li>&lf;
</xsl:template>
<!-- /section index -->
<!-- ==================================================================== -->
<!-- docs super menu -->
<!-- ==================================================================== -->
<xsl:template name="super-menu">
<p class="menu">
<a href="{$path}/mod/{$index-file}">
<xsl:value-of select="$message[@id='modules']" />
</a>
<xsl:text> | </xsl:text>
<a href="{$path}/mod/directives.html">
<xsl:value-of select="$message[@id='directives']" />
</a>
<xsl:text> | </xsl:text>
<a href="{$path}/faq/{$index-file}">
<xsl:value-of select="$message[@id='faq']" />
</a>
<xsl:text> | </xsl:text>
<a href="{$path}/glossary.html">
<xsl:value-of select="$message[@id='glossary']" />
</a>
<xsl:text> | </xsl:text>
<a href="{$path}/sitemap.html">
<xsl:value-of select="$message[@id='sitemap']" />
</a>
</p>
</xsl:template>
<!-- /super-menu -->
<!-- ==================================================================== -->
<!-- <example> -->
<!-- iterate over *all* nodes; bare text and other inline stuff is -->
<!-- wrapped into <p><code>, block level elements (defined in -->
<!-- $blockelements) are applied "as is" -->
<!-- ==================================================================== -->
<xsl:variable name="blocks"
select="concat(' ', normalize-space($blockelements), ' ')" />
<xsl:template match="example">
<div class="example">
<xsl:apply-templates select="title" mode="print" />
<xsl:for-each select="/node()">
<xsl:variable name="is-block-node"
select="boolean(contains($blocks,
concat(' ', local-name(), ' ')))"/>
<!-- bb = (number of) blocks nodes before (the current) -->
<xsl:variable name="bb"
select="count(preceding-sibling::*[
contains($blocks,
concat(' ', local-name(), ' '))])" />
<xsl:if test="$is-block-node or position()=last()">
<xsl:variable name="content">
<!-- phew. short explanation, what happens here: -->
<!-- We want to get the inline stuff between the last -->
<!-- block node and the current node. -->
<!-- So filter all previous nodes for the condition -->
<!-- that the number of block nodes of all of *their* -->
<!-- previous nodes is >= $bb. Hope that helps ;-) -->
<xsl:apply-templates
select="preceding-sibling::node()[
count(preceding-sibling::*[
contains($blocks,
concat(' ', local-name(), ' '))])
&gt;= $bb]" />
<xsl:apply-templates
select="self::node()[not($is-block-node)]" />
</xsl:variable>
<!-- apply bare text only, if it's not only \s or empty -->
<xsl:if test="not(normalize-space($content) = '')">
<p><code>
<!-- same as $content above. xsl:copy-of seems to make -->
<!-- thread problems with xalan-j ... -->
<xsl:apply-templates
select="preceding-sibling::node()[
count(preceding-sibling::*[
contains($blocks,
concat(' ', local-name(),
' '))])
&gt;= $bb]" />
<xsl:apply-templates
select="self::node()[not($is-block-node)]" />
</code></p>
</xsl:if>
<xsl:apply-templates select="self::node()[$is-block-node]" />
</xsl:if>
</xsl:for-each>
<!-- /node() -->
</div> <!-- /.example -->
</xsl:template>
<!-- /example -->
<!-- ==================================================================== -->
<!-- example/title -->
<!-- ==================================================================== -->
<xsl:template match="example/title" mode="print">
<h3>
<xsl:apply-templates/>
</h3>
</xsl:template>
<xsl:template match="example/title" />
<!-- /example/title -->
<!-- ==================================================================== -->
<!-- indentations -->
<!-- ==================================================================== -->
<xsl:template match="indent">
<span class="indent">
<xsl:apply-templates/>
</span>
</xsl:template>
<!-- /indent -->
<!-- ==================================================================== -->
<!-- <note> -->
<!-- ==================================================================== -->
<xsl:template match="note">
<div class="note">
<xsl:if test="@type='warning'">
<xsl:attribute name="class">warning</xsl:attribute>
</xsl:if>
<xsl:apply-templates/>
</div>
</xsl:template>
<!-- /note -->
<!-- ==================================================================== -->
<!-- <note><title> -->
<!-- ==================================================================== -->
<xsl:template match="note/title">
<h3>
<xsl:apply-templates/>
</h3>
</xsl:template>
<!-- /note/title -->
<!-- ==================================================================== -->
<!-- <directive> -->
<!-- Inserts link to another directive, which might be in another module. -->
<!-- References are converted into lower case. -->
<!-- ==================================================================== -->
<xsl:template match="directive" name="directive">
<code class="directive">
<xsl:choose>
<xsl:when test="@module">
<xsl:variable name="lowerdirective"
select="translate(., $uppercase, $lowercase)" />
<xsl:choose>
<xsl:when test="$in-modulesynopsis and @module = /modulesynopsis/name">
<a href="#{$lowerdirective}">
<xsl:if test="@type='section'">&lt;</xsl:if>
<xsl:value-of select="."/>
<xsl:if test="@type='section'">&gt;</xsl:if>
</a>
</xsl:when>
<xsl:otherwise>
<a href="{$path}/mod/{@module}.html#{$lowerdirective}">
<xsl:if test="@type='section'">&lt;</xsl:if>
<xsl:value-of select="."/>
<xsl:if test="@type='section'">&gt;</xsl:if>
</a>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:if test="@type='section'">&lt;</xsl:if>
<xsl:value-of select="."/>
<xsl:if test="@type='section'">&gt;</xsl:if>
</xsl:otherwise>
</xsl:choose>
</code>
</xsl:template>
<!-- /directive -->
<!-- ==================================================================== -->
<!-- <module> -->
<!-- Inserts a link to refereed module -->
<!-- ==================================================================== -->
<xsl:template match="module" name="module">
<code class="module">
<a href="{$path}/mod/{.}.html">
<xsl:value-of select="."/>
</a>
</code>
</xsl:template>
<!-- /module -->
<!-- ==================================================================== -->
<!-- <program> -->
<!-- Inserts a link to referred program -->
<!-- ==================================================================== -->
<xsl:template match="program">
<code class="program">
<a href="{$path}/programs/{normalize-space(.)}.html">
<xsl:value-of select="normalize-space(.)" />
</a>
</code>
</xsl:template>
<!-- /program -->
<!-- ==================================================================== -->
<!-- <related> -->
<!-- ==================================================================== -->
<xsl:template match="related">
<table class="related">
<tr>
<th>
<xsl:value-of select="$message[@id='relatedmodules']" />
</th>
<th>
<xsl:value-of select="$message[@id='relateddirectives']" />
</th>
</tr>
<tr>
<td>
<xsl:if test="count(modulelist/*) &gt; 0">
<ul>
<xsl:apply-templates select="modulelist" />
</ul>
</xsl:if>
</td>
<td>
<xsl:if test="count(directivelist/*) &gt; 0">
<ul>
<xsl:apply-templates select="directivelist"/>
</ul>
</xsl:if>
</td>
</tr>
</table>
</xsl:template>
<!-- /related -->
<!-- ==================================================================== -->
<!-- related/modulelist -->
<!-- ==================================================================== -->
<xsl:template match="related/modulelist">
<xsl:for-each select="module">
<li>
<xsl:call-template name="module"/>
</li>
</xsl:for-each>
</xsl:template>
<!-- /related/modulelist -->
<!-- ==================================================================== -->
<!-- related/directivelist -->
<!-- ==================================================================== -->
<xsl:template match="related/directivelist">
<xsl:for-each select="directive">
<li>
<xsl:call-template name="directive"/>
</li>
</xsl:for-each>
</xsl:template>
<!-- /related/directivelist -->
<!-- ==================================================================== -->
<!-- <table> -->
<!-- ==================================================================== -->
<xsl:template match="table">
<table>
<!-- existing border attribute will result in <table class="bordered"> -->
<xsl:if test="@border">
<xsl:attribute name="class">bordered</xsl:attribute>
</xsl:if>
<xsl:choose>
<xsl:when test="@style = 'zebra'">
<xsl:apply-templates select="tr" mode="zebra-table" />
</xsl:when>
<xsl:when test="@style = 'data'">
<xsl:apply-templates select="tr" mode="data-table" />
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates />
</xsl:otherwise>
</xsl:choose>
</table>
</xsl:template>
<!-- /table -->
<!-- data-table -->
<xsl:template match="tr" mode="data-table">
<!-- style="data": fixed font, padding-left and right alignment for <td>s -->
<xsl:variable name="cross-table" select="boolean(
preceding-sibling::tr/th[1]|following-sibling::tr/th[1])" />
<tr>
<xsl:for-each select="node()">
<xsl:choose>
<xsl:when test="local-name() = 'td'">
<td class="data">
<xsl:apply-templates select="*|@*|text()" />
</td>
</xsl:when>
<xsl:when test="local-name() = 'th' and
(not($cross-table) or
count(preceding-sibling::*) &gt; 0)">
<th class="data">
<xsl:apply-templates select="*|@*|text()" />
</th>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="self::node()" />
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</tr>&lf;
</xsl:template>
<!-- zebra-table -->
<xsl:template match="tr" mode="zebra-table">
<!-- style="zebra": alternating colors per row, i.e. every second row -->
<!-- gets a class="odd". Header lines (no <td>) get a -->
<!-- class="header". These lines will be excluded from -->
<!-- the "odd" line count. That way header lines act -->
<!-- interjectional, which creates a better visual and -->
<!-- psychological effect. -->
<tr>
<xsl:choose>
<xsl:when test="count(td) = 0">
<xsl:attribute name="class">header</xsl:attribute>
</xsl:when>
<xsl:when test="position() mod 2 = (count(preceding-sibling::tr[count(td) = 0]) mod 2)">
<xsl:attribute name="class">odd</xsl:attribute>
</xsl:when>
</xsl:choose>
<xsl:apply-templates />
</tr>&lf;
</xsl:template>
<!-- /zebra-table -->
<!-- ==================================================================== -->
<!-- <ol> -->
<!-- ==================================================================== -->
<xsl:template match="ol">
<ol>
<!-- A. B. C. D. (list-style-type="upper-alpha") -->
<xsl:choose>
<xsl:when test="@type = 'A'">
<xsl:attribute name="class">up-A</xsl:attribute>
</xsl:when>
<xsl:when test="@type = 'a'">
<xsl:attribute name="class">lo-A</xsl:attribute>
</xsl:when>
</xsl:choose>
<xsl:apply-templates/>
</ol>
</xsl:template>
<!-- /ol -->
<!-- ==================================================================== -->
<!-- diverse elements -->
<!-- Passes through content -->
<!-- ==================================================================== -->
<xsl:template match="summary|description|usage|syntax|default">
<xsl:apply-templates/>
</xsl:template>
<!-- /diverse -->
<!-- ==================================================================== -->
<!-- <a> -->
<!-- ==================================================================== -->
<xsl:template match="a">
<xsl:choose>
<xsl:when test="not(@href)">
<xsl:copy>
<xsl:apply-templates select="@*|*|text()"/>
</xsl:copy>
</xsl:when>
<xsl:otherwise>
<a href="@href">
<xsl:apply-templates select="@*"/>
<xsl:call-template name="helper.uri.fix">
<xsl:with-param name="uri" select="@href"/>
</xsl:call-template>
<xsl:apply-templates select="*|text()"/>
</a>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- /a -->
<!-- ==================================================================== -->
<!-- toplink -->
<!-- ==================================================================== -->
<xsl:template name="toplink">
<div class="top">
<a href="#page-header"><img src="{$path}/images/up.gif" alt="top" /></a>
</div>
</xsl:template>
<!-- /toplink -->
<!-- ==================================================================== -->
<!-- <transnote> -->
<!-- translator's notes are displayed in a different color -->
<!-- ==================================================================== -->
<xsl:template match="transnote">
<span class="transnote">
<xsl:text>(</xsl:text>
<em>
<xsl:value-of select="$message[@id='transnote']" />
</em>
<xsl:text> </xsl:text>
<xsl:apply-templates />
<xsl:text>)</xsl:text>
</span>
</xsl:template>
<!-- /transnote -->
<!-- ==================================================================== -->
<!-- <phonetic> -->
<!-- phonetics are enclosed in square brackets and displayed in a -->
<!-- different color -->
<!-- ==================================================================== -->
<xsl:template match="phonetic">
<span class="phonetic">
<xsl:text>[</xsl:text>
<xsl:apply-templates />
<xsl:text>]</xsl:text>
</span>
</xsl:template>
<!-- /phonetic -->
<!-- ==================================================================== -->
<!-- <glossary> -->
<!-- link to a glossary anchor -->
<!-- ==================================================================== -->
<xsl:template match="glossary">
<xsl:variable name="glosslink">
<xsl:choose>
<xsl:when test="@ref">
<xsl:value-of select="@ref"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="translate(., $uppercase, $lowercase)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<a href="{$path}/glossary.html#{$glosslink}" class="glossarylink">
<xsl:attribute name="title">
<xsl:value-of select="$message[@id='glossarylink']" />
</xsl:attribute>
<xsl:apply-templates />
</a>
</xsl:template>
<!-- /glossary -->
<!-- ==================================================================== -->
<!-- Filter &#160; in text() nodes. -->
<!-- In some environments this character won't be transformed correctly, -->
<!-- so we just write it explicitely as "&nbsp;" into the output. -->
<!-- ==================================================================== -->
<xsl:template match="text()" name="filter.nbsp">
<xsl:param name="text" select="." />
<xsl:choose>
<xsl:when test="contains($text, '&#160;')">
<xsl:value-of select="substring-before($text, '&#160;')" />
&nbsp;
<xsl:call-template name="filter.nbsp">
<xsl:with-param name="text" select="substring-after($text, '&#160;')" />
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$text" />
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- /filter.nbsp -->
<!-- ==================================================================== -->
<!-- Process everything else by just passing it through -->
<!-- ==================================================================== -->
<xsl:template match="*">
<xsl:message terminate="yes">
<xsl:text>Unknown element: </xsl:text>
<xsl:value-of select="local-name()" />&lf;
<xsl:text>Is the document valid (try `build validate-xml`)?</xsl:text>
</xsl:message>
</xsl:template>
<xsl:template match="@*">
<xsl:copy>
<xsl:apply-templates select="*|@*|text()" />
</xsl:copy>
</xsl:template>
<xsl:template match="br"><br /></xsl:template>
<xsl:template match="tr"><tr><xsl:apply-templates select="*|@*|text()" /></tr></xsl:template>
<xsl:template match="th"><th><xsl:apply-templates select="*|@*|text()" /></th></xsl:template>
<xsl:template match="td"><td><xsl:apply-templates select="*|@*|text()" /></td></xsl:template>
<xsl:template match="p"><p><xsl:apply-templates select="*|@*|text()" /></p></xsl:template>
<xsl:template match="ul"><ul><xsl:apply-templates select="*|@*|text()" /></ul></xsl:template>
<xsl:template match="li"><li><xsl:apply-templates select="*|@*|text()" /></li></xsl:template>
<xsl:template match="dl"><dl><xsl:apply-templates select="*|@*|text()" /></dl></xsl:template>
<xsl:template match="dt"><dt><xsl:apply-templates select="*|@*|text()" /></dt></xsl:template>
<xsl:template match="dd"><dd><xsl:apply-templates select="*|@*|text()" /></dd></xsl:template>
<xsl:template match="em"><em><xsl:apply-templates select="*|@*|text()" /></em></xsl:template>
<xsl:template match="strong"><strong><xsl:apply-templates select="*|@*|text()" /></strong></xsl:template>
<xsl:template match="pre"><pre><xsl:apply-templates select="*|@*|text()" /></pre></xsl:template>
<xsl:template match="code"><code><xsl:apply-templates select="*|@*|text()" /></code></xsl:template>
<xsl:template match="var"><var><xsl:apply-templates select="*|@*|text()" /></var></xsl:template>
<xsl:template match="dfn"><dfn><xsl:apply-templates select="*|@*|text()" /></dfn></xsl:template>
<xsl:template match="blockquote"><blockquote><xsl:apply-templates select="*|@*|text()" /></blockquote></xsl:template>
<xsl:template match="q"><q><xsl:apply-templates select="*|@*|text()" /></q></xsl:template>
<xsl:template match="cite"><cite><xsl:apply-templates select="*|@*|text()" /></cite></xsl:template>
<xsl:template match="img"><img><xsl:apply-templates select="*|@*|text()" /></img></xsl:template>
<!-- /pass through -->
<!-- ==================================================================== -->
<!-- create a letter bar -->
<!-- ==================================================================== -->
<xsl:template name="letter-bar">
<xsl:param name="letters" />
<xsl:param name="first" />
<xsl:if test="not($first)">
<xsl:text> | </xsl:text>
</xsl:if>
<a href="#{substring($letters,1,1)}">
&nbsp;
<xsl:value-of select="substring($letters, 1, 1)" />
&nbsp;
</a>
<xsl:if test="string-length($letters) &gt; 1">
<xsl:call-template name="letter-bar">
<xsl:with-param name="letters" select="substring($letters, 2)" />
<xsl:with-param name="first" select="false()" />
</xsl:call-template>
</xsl:if>
</xsl:template>
<!-- /letter-bar -->
<!-- ==================================================================== -->
<!-- template(s) for collecting all start letters of directives -->
<!-- ==================================================================== -->
<xsl:template name="directive-startletters">
<xsl:param name="directives" />
<xsl:call-template name="_squeeze-letters">
<xsl:with-param name="lastletter" select="''" />
<xsl:with-param name="letters">
<xsl:for-each select="$directives">
<xsl:sort select="name"/>
<xsl:value-of
select="translate(substring(normalize-space(name), 1, 1),
$lowercase, $uppercase)" />
</xsl:for-each>
</xsl:with-param>
</xsl:call-template>
</xsl:template>
<!-- /directive-startletters -->
<!-- ==================================================================== -->
<!-- squeeze subsequent letters in a string -->
<!-- ==================================================================== -->
<xsl:template name="_squeeze-letters">
<xsl:param name="letters"/>
<xsl:param name="lastletter"/>
<xsl:variable name="current" select="substring($letters, 1, 1)" />
<xsl:if test="not($lastletter = $current)">
<xsl:value-of select="$current" />
</xsl:if>
<xsl:if test="string-length($letters) &gt; 1">
<xsl:call-template name="_squeeze-letters">
<xsl:with-param name="letters" select="substring($letters, 2)" />
<xsl:with-param name="lastletter" select="$current"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<!-- /_squeeze-letters -->
<!-- ==================================================================== -->
<!-- fix href and target attribute of an element. -->
<!-- ==================================================================== -->
<xsl:template name="helper.uri.fix">
<xsl:param name="uri"/>
<xsl:choose>
<!-- lame is_absolute_uri test -->
<xsl:when test=" contains($uri, ':')
and string-length(substring-before($uri, ':')) &lt; 7">
<xsl:if test="$ext-target">
<xsl:attribute name="target">_blank</xsl:attribute>
</xsl:if>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="fragment">
<xsl:if test="contains($uri, '#')">
<xsl:value-of select="concat('#', substring-after($uri, '#'))"/>
</xsl:if>
</xsl:variable>
<xsl:variable name="absuri">
<xsl:choose>
<xsl:when test="contains($uri, '#')">
<xsl:value-of select="concat('#', substring-before($uri, '#'))"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$uri"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="substring($absuri, string-length($uri), 1) = '/'">
<xsl:attribute name="href">
<xsl:value-of select="concat($absuri, $index-file, $fragment)"/>
</xsl:attribute>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- /helper.uri.fix -->
<!-- ==================================================================== -->
<!-- Ignore table hints used for latex -->
<!-- ==================================================================== -->
<xsl:template match="columnspec">
</xsl:template>
<xsl:template match="column">
</xsl:template>
</xsl:stylesheet>