common.xsl revision ab3f278fbf670b521b2e7fd6fe93732059e2bf24
2N/A<?xml version="1.0"?><!--
2N/A/* ====================================================================
2N/A * The Apache Software License, Version 1.1
2N/A *
2N/A * Copyright (c) 2002-2004 The Apache Software Foundation. All rights
2N/A * reserved.
2N/A *
2N/A * Redistribution and use in source and binary forms, with or without
2N/A * modification, are permitted provided that the following conditions
2N/A * are met:
2N/A *
2N/A * 1. Redistributions of source code must retain the above copyright
2N/A * notice, this list of conditions and the following disclaimer.
2N/A *
2N/A * 2. Redistributions in binary form must reproduce the above copyright
2N/A * notice, this list of conditions and the following disclaimer in
2N/A * the documentation and/or other materials provided with the
2N/A * distribution.
2N/A *
2N/A * 3. The end-user documentation included with the redistribution,
727N/A * if any, must include the following acknowledgment:
2N/A * "This product includes software developed by the
2N/A * Apache Software Foundation (http://www.apache.org/)."
32N/A * Alternately, this acknowledgment may appear in the software itself,
32N/A * if and wherever such third-party acknowledgments normally appear.
313N/A *
313N/A * 4. The names "Apache" and "Apache Software Foundation" must
313N/A * not be used to endorse or promote products derived from this
313N/A * software without prior written permission. For written
313N/A * permission, please contact apache@apache.org.
313N/A *
313N/A * 5. Products derived from this software may not be called "Apache",
313N/A * nor may "Apache" appear in their name, without prior written
313N/A * permission of the Apache Software Foundation.
313N/A *
313N/A * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
313N/A * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
313N/A * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
313N/A * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
313N/A * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
313N/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
127N/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
127N/A * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
127N/A * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
127N/A * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
538N/A * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
538N/A * SUCH DAMAGE.
538N/A * ====================================================================
538N/A *
538N/A * This software consists of voluntary contributions made by many
538N/A * individuals on behalf of the Apache Software Foundation. For more
538N/A * information on the Apache Software Foundation, please see
538N/A * <http://www.apache.org/>.
327N/A */ -->
327N/A<!DOCTYPE xsl:stylesheet [
327N/A <!ENTITY nbsp SYSTEM "util/nbsp.xml">
327N/A <!ENTITY lf SYSTEM "util/lf.xml">
327N/A]>
327N/A<xsl:stylesheet version="1.0"
327N/A xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
327N/A xmlns="http://www.w3.org/1999/xhtml">
327N/A
327N/A<!-- -->
327N/A<!-- Please, don't hard-code output strings! Use the language -->
327N/A<!-- files and the translation "stuff"... -->
177N/A<!-- -->
177N/A
2N/A<!-- Injected variables: -->
145N/A<!-- $is-chm - (boolean) target is for CHM generation or not -->
26N/A<!-- $is-zip - (boolean) target is for ZIP generation or not -->
38N/A<!-- $messages - (node-set) localized common text snippets -->
38N/A<!-- $output-encoding - (string) MIME charset name of the output -->
26N/A<!-- encoding -->
26N/A
477N/A<!-- Constants used for case translation -->
538N/A<xsl:variable name="lowercase" select="'abcdefghijklmnopqrstuvwxyz'" />
38N/A<xsl:variable name="uppercase" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'" />
2N/A
6N/A<!-- space separated list of blockelements defined in common.dtd -->
2N/A<!-- used for inline content catching in <example>s -->
727N/A<xsl:variable name="blockelements">
2N/A p example note table ul ol dl pre img blockquote
34N/A</xsl:variable>
34N/A
94N/A<!-- relative path to /manual/ -->
94N/A<xsl:variable name="path" select="document(/*/@metafile)/metafile/relpath" />
156N/A
156N/A<!-- load outsourced page types -->
34N/A<xsl:include href="moduleindex.xsl" />
59N/A<xsl:include href="directiveindex.xsl" />
72N/A<xsl:include href="manualpage.xsl" />
72N/A<xsl:include href="synopsis.xsl" />
72N/A<xsl:include href="sitemap.xsl" />
59N/A<xsl:include href="indexpage.xsl" />
2N/A<xsl:include href="quickreference.xsl" />
85N/A<xsl:include href="faq.xsl" />
61N/A
61N/A<!-- load utility snippets -->
220N/A<xsl:include href="util/modtrans.xsl" />
61N/A
61N/A<!-- make sure, we set relative anchors only, if we're actually -->
172N/A<!-- transforming a modulefile (see <directive> template) -->
61N/A<xsl:variable name="in-modulesynopsis" select="boolean(/modulesynopsis)" />
61N/A
220N/A<!-- when referencing to a directory, we may need to complete the path -->
220N/A<!-- with the index file (for offline applications like *.chm files) -->
61N/A<xsl:variable name="index-file">
172N/A <xsl:if test="$is-chm or $is-zip">index.html</xsl:if>
454N/A</xsl:variable>
61N/A
172N/A<!-- it may be desired to open external targets in a new window -->
61N/A<xsl:variable name="ext-target" select="boolean($is-chm)" />
152N/A
74N/A<!-- #################################################################### -->
61N/A<!-- Utility templates for constructing pages -->
220N/A<!-- #################################################################### -->
85N/A
172N/A<!-- ==================================================================== -->
61N/A<!-- HTML head -->
172N/A<!-- ==================================================================== -->
61N/A<xsl:template name="head">
172N/A<head>
61N/A <!-- the meta element is necessary for offline handling like CHM -->
61N/A <xsl:choose>
220N/A <xsl:when test="$is-chm or $is-zip">
61N/A <meta http-equiv="Content-Type"
454N/A content="text/html; charset={$output-encoding}" />
61N/A </xsl:when>
172N/A <xsl:otherwise>
61N/A <xsl:comment>
172N/A &lf;
61N/A <xsl:text> </xsl:text>
152N/A <xsl:text>XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</xsl:text>
152N/A &lf;
220N/A <xsl:text> </xsl:text>
61N/A <xsl:text>This file is generated from xml source: DO NOT EDIT</xsl:text>
61N/A &lf;
43N/A <xsl:text> </xsl:text>
220N/A <xsl:text>XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</xsl:text>
43N/A &lf;
120N/A <xsl:text> </xsl:text>
64N/A </xsl:comment>
64N/A </xsl:otherwise>
64N/A </xsl:choose>&lf;
43N/A
43N/A <title>
120N/A <xsl:choose>
64N/A <xsl:when test="name">
64N/A <xsl:value-of select="name"/>
64N/A </xsl:when>
220N/A
64N/A <xsl:otherwise>
64N/A <xsl:value-of select="title"/>
486N/A </xsl:otherwise>
486N/A </xsl:choose>
64N/A
64N/A <xsl:text> </xsl:text>
64N/A <xsl:value-of select="$messages/message[@name='apachetitle']"/>
64N/A </title>&lf;
64N/A
64N/A <!-- chm files get a slightly different stylesheet -->
64N/A <xsl:choose>
43N/A <xsl:when test="$is-chm">
16N/A <link type="text/css" rel="stylesheet" media="all"
16N/A href="{$path}/style/css/manual-chm.css" />
16N/A </xsl:when>
34N/A <!-- zip packages do also -->
34N/A <xsl:when test="$is-zip">
16N/A <link title="Main stylesheet" type="text/css" media="all"
6N/A rel="stylesheet"
12N/A href="{$path}/style/css/manual-zip.css" />&lf;
12N/A <link title="No Sidebar - Default font size" type="text/css" media="all"
12N/A rel="alternate stylesheet"
12N/A href="{$path}/style/css/manual-zip-100pc.css"/>
12N/A </xsl:when>
12N/A <xsl:otherwise>
12N/A <link title="Main stylesheet" type="text/css" media="all"
12N/A rel="stylesheet"
12N/A href="{$path}/style/css/manual.css" />&lf;
12N/A <link title="No Sidebar - Default font size" type="text/css" media="all"
12N/A rel="alternate stylesheet"
369N/A href="{$path}/style/css/manual-loose-100pc.css"/>
369N/A </xsl:otherwise>
369N/A </xsl:choose>&lf;
61N/A
61N/A <link type="text/css" media="print"
61N/A rel="stylesheet"
61N/A href="{$path}/style/css/manual-print.css"/>
61N/A
12N/A <!-- chm files do not need a favicon -->
181N/A <xsl:if test="not($is-chm or $is-zip)">&lf;
181N/A <link rel="shortcut icon" href="{$path}/images/favicon.ico" />
12N/A </xsl:if>
61N/A</head>
61N/A</xsl:template>
12N/A<!-- /head -->
279N/A
279N/A
181N/A<!-- ==================================================================== -->
181N/A<!-- page top -->
181N/A<!-- ==================================================================== -->
2N/A<xsl:template name="top">
99N/A<div id="page-header">&lf;
99N/A <xsl:call-template name="super-menu" />&lf;
99N/A
181N/A <p class="apache">
181N/A <xsl:value-of select="$messages/message[@name='apachehttpserver']"/>
181N/A </p>&lf;
181N/A
181N/A <img src="{$path}/images/feather.gif" alt="" />
99N/A</div>&lf; <!-- /page-header -->
40N/A
40N/A<div class="up">
40N/A <a href="./{$index-file}">
40N/A <xsl:if test="parentdocument">
43N/A <xsl:attribute name="href">
40N/A <xsl:value-of select="parentdocument/@href"/>
127N/A </xsl:attribute>
2N/A
99N/A <xsl:call-template name="helper.uri.fix">
206N/A <xsl:with-param name="uri" select="parentdocument/@href" />
2N/A </xsl:call-template>
99N/A </xsl:if>
206N/A
2N/A <img src="{$path}/images/left.gif" alt="&lt;-" title="&lt;-" />
151N/A </a>
206N/A</div>&lf;
2N/A
151N/A<div id="path">&lf;
206N/A <a href="http://www.apache.org/">
2N/A <xsl:if test="$ext-target">
2N/A <xsl:attribute name="target">_blank</xsl:attribute>
206N/A </xsl:if>
2N/A <xsl:value-of select="$messages/message[@name='apache']" />
61N/A </a>
61N/A
61N/A <xsl:text> &gt; </xsl:text>
61N/A
61N/A <a href="http://httpd.apache.org/">
16N/A <xsl:if test="$ext-target">
16N/A <xsl:attribute name="target">_blank</xsl:attribute>
727N/A </xsl:if>
727N/A <xsl:value-of select="$messages/message[@name='http-server']" />
727N/A </a>
727N/A
727N/A <xsl:text> &gt; </xsl:text>
727N/A
727N/A <a href="http://httpd.apache.org/docs-project/">
727N/A <xsl:if test="$ext-target">
148N/A <xsl:attribute name="target">_blank</xsl:attribute>
148N/A </xsl:if>
148N/A <xsl:value-of select="$messages/message[@name='documentation']" />
148N/A </a>
2N/A
47N/A <xsl:if test="not(/indexpage)">
2N/A <xsl:text> &gt; </xsl:text>
727N/A
727N/A <a href="{$path}/{$index-file}">
727N/A <xsl:value-of select="$messages/message[@name='version']"/>
2N/A </a>
2N/A </xsl:if>
148N/A
2N/A <xsl:if test="/modulesynopsis or /directiveindex or /quickreference">
146N/A <xsl:text> &gt; </xsl:text>
146N/A
146N/A <a href="./{$index-file}">
146N/A <xsl:value-of select="$messages/message[@name='modules']"/>
727N/A </a>
146N/A </xsl:if>
116N/A
116N/A <xsl:if test="parentdocument/text()">
260N/A <xsl:text> &gt; </xsl:text>
260N/A
277N/A <a href="{parentdocument/@href}">
260N/A <xsl:call-template name="helper.uri.fix">
260N/A <xsl:with-param name="uri" select="parentdocument/@href"/>
260N/A </xsl:call-template>
260N/A <xsl:value-of select="parentdocument"/>
260N/A </a>
260N/A </xsl:if>
260N/A</div> <!-- /path -->
127N/A</xsl:template>
260N/A<!-- /top -->
260N/A
260N/A
260N/A<!-- ==================================================================== -->
260N/A<!-- page bottom -->
260N/A<!-- ==================================================================== -->
260N/A<xsl:template name="bottom">
260N/A<xsl:call-template name="langavail">
260N/A <xsl:with-param name="position" select="'bottom'" />
260N/A</xsl:call-template>
260N/A
260N/A<div id="footer">&lf;
2N/A <p class="apache">
2N/A <xsl:value-of select="$messages/message[@name='maintainedby']"/>
82N/A <xsl:text> </xsl:text>
99N/A <a href="http://httpd.apache.org/docs-project/">
99N/A <xsl:if test="$ext-target">
302N/A <xsl:attribute name="target">_blank</xsl:attribute>
2N/A </xsl:if>
105N/A <xsl:text>Apache HTTP Server Documentation Project</xsl:text>
2N/A </a>
70N/A </p>&lf;
2N/A
160N/A <xsl:call-template name="super-menu"/>
160N/A
160N/A</div> <!-- /footer -->
160N/A</xsl:template>
165N/A<!-- /bottom -->
2N/A
2N/A
2N/A<!-- ==================================================================== -->
7N/A<!-- build an "available languages" section -->
142N/A<!-- ==================================================================== -->
43N/A<xsl:template name="langavail">
43N/A<xsl:param name="position" select="'top'" />
16N/A<xsl:variable name="metafile" select="document(/*/@metafile)/metafile" />
43N/A
138N/A<xsl:if test="not($is-chm or $is-zip)">
224N/A<div class="{$position}lang">&lf;
224N/A <p>
61N/A <span>
61N/A <xsl:value-of select="$messages/message[@name='langavail']" />
61N/A <xsl:text>: </xsl:text>
61N/A </span>
206N/A
206N/A <xsl:for-each select="$metafile/variants/variant">
206N/A <xsl:sort select="." />
206N/A
206N/A <a href="{$path}/{.}{$metafile/path}{$metafile/basename}.html">
61N/A <xsl:if test="$metafile/basename = 'index'">
99N/A <xsl:attribute name="href">
99N/A <xsl:value-of
99N/A select="concat($path, '/', ., $metafile/path)" />
99N/A </xsl:attribute>
99N/A </xsl:if>
99N/A <xsl:if test="$messages/@lang != .">
99N/A <xsl:attribute name="hreflang">
99N/A <xsl:value-of select="." />
99N/A </xsl:attribute>
61N/A <xsl:attribute name="rel">alternate</xsl:attribute>
99N/A </xsl:if>
99N/A <xsl:attribute name="title">
99N/A <xsl:choose>
99N/A <xsl:when test=". != 'fr'"> <!-- no language file avail. -->
99N/A <xsl:value-of select="document(concat('/lang/', ., '.xml'))
61N/A /messages/@langname" />
99N/A </xsl:when>
99N/A <xsl:otherwise>
99N/A <xsl:text>Fran&#231;ais</xsl:text>
99N/A </xsl:otherwise>
61N/A </xsl:choose>
61N/A </xsl:attribute>
61N/A
61N/A &nbsp;
99N/A <xsl:value-of select="." />
99N/A &nbsp;
99N/A </a>
99N/A <xsl:if test="position() != last()">
200N/A <xsl:text> |&#xA;</xsl:text>
200N/A </xsl:if>
200N/A </xsl:for-each>
99N/A </p>&lf;
99N/A</div> <!-- /.{$position}lang -->
99N/A</xsl:if>
99N/A</xsl:template>
99N/A<!-- /langavail -->
99N/A
99N/A
99N/A<!-- ==================================================================== -->
99N/A<!-- Process a documentation section -->
99N/A<!-- ==================================================================== -->
99N/A<xsl:template match="section">
99N/A<xsl:call-template name="toplink" />&lf;
99N/A<div class="section">&lf;
99N/A
102N/A <!-- Section heading -->
108N/A <h2>
102N/A <xsl:choose>
61N/A <xsl:when test="@id">
99N/A <a id="{@id}" name="{@id}">
99N/A <xsl:apply-templates select="title" mode="print" />
99N/A </a>
99N/A </xsl:when>
99N/A
99N/A <xsl:otherwise>
99N/A <xsl:apply-templates select="title" mode="print" />
99N/A </xsl:otherwise>
99N/A </xsl:choose>
99N/A </h2>
99N/A
99N/A <!-- Section body -->
99N/A <xsl:apply-templates />
99N/A</div> <!-- /.section -->
99N/A</xsl:template>
200N/A<!-- /section -->
200N/A
200N/A
200N/A<!-- ==================================================================== -->
200N/A<!-- handle subsections (lower level headings) -->
200N/A<!-- ==================================================================== -->
200N/A<xsl:template match="section/section">
200N/A<!-- Section heading -->
200N/A<h3>
200N/A <xsl:choose>
99N/A <xsl:when test="@id">
99N/A <a id="{@id}" name="{@id}">
99N/A <xsl:apply-templates select="title" mode="print" />
99N/A </a>
99N/A </xsl:when>
102N/A
102N/A <xsl:otherwise>
102N/A <xsl:apply-templates select="title" mode="print" />
102N/A </xsl:otherwise>
102N/A </xsl:choose>
99N/A</h3>
99N/A
99N/A<!-- Section body -->
61N/A<xsl:apply-templates />
61N/A</xsl:template>
61N/A<!-- /section/section -->
61N/A
99N/A
99N/A<!-- ==================================================================== -->
102N/A<!-- handle subsubsections (h4) -->
99N/A<!-- ==================================================================== -->
99N/A<xsl:template match="section/section/section">
99N/A<!-- Section heading -->
99N/A<h4>
459N/A <xsl:choose>
459N/A <xsl:when test="@id">
459N/A <a id="{@id}" name="{@id}">
459N/A <xsl:apply-templates select="title" mode="print" />
459N/A </a>
459N/A </xsl:when>
459N/A
99N/A <xsl:otherwise>
102N/A <xsl:apply-templates select="title" mode="print" />
99N/A </xsl:otherwise>
459N/A </xsl:choose>
459N/A</h4>
459N/A
459N/A<!-- Section body -->
109N/A<xsl:apply-templates/>
109N/A
109N/A</xsl:template>
109N/A<!-- /section/section/section -->
109N/A
109N/A
109N/A<!-- ==================================================================== -->
109N/A<!-- section nesting > h4 is not supported for now -->
109N/A<!-- ==================================================================== -->
109N/A<xsl:template match="section/section/section/section">
109N/A<xsl:message terminate="yes">
109N/A <xsl:text>FATAL: exceeding maximum section nesting level.</xsl:text>
99N/A &lf;&lf;
99N/A <xsl:text>Perhaps you should consider to split your document into</xsl:text>
99N/A &lf;
99N/A <xsl:text>several ones...</xsl:text>
200N/A &lf;
200N/A</xsl:message>
200N/A</xsl:template>
200N/A<!-- /section/section/section/section -->
99N/A
99N/A
99N/A<!-- ==================================================================== -->
99N/A<!-- (sub)section titles -->
99N/A<!-- ==================================================================== -->
99N/A<xsl:template match="section/title" mode="print">
109N/A<xsl:apply-templates/>
109N/A</xsl:template>
61N/A<xsl:template match="section/title" />
99N/A<!-- /section/title -->
99N/A
99N/A
99N/A<!-- ==================================================================== -->
99N/A<!-- generate section index -->
99N/A<!-- ==================================================================== -->
99N/A<xsl:template match="section" mode="index">
99N/A<li>
99N/A <img src="{$path}/images/down.gif" alt="" />
99N/A <xsl:text> </xsl:text>
99N/A <xsl:choose>
61N/A <xsl:when test="@id">
99N/A <a href="#{@id}">
99N/A <xsl:apply-templates select="title" mode="print" />
99N/A </a>
99N/A </xsl:when>
99N/A <xsl:otherwise>
99N/A <xsl:apply-templates select="title" mode="print" />
99N/A </xsl:otherwise>
99N/A </xsl:choose>
99N/A</li>&lf;
99N/A</xsl:template>
99N/A<!-- /section index -->
459N/A
99N/A
99N/A<!-- ==================================================================== -->
99N/A<!-- docs super menu -->
99N/A<!-- ==================================================================== -->
99N/A<xsl:template name="super-menu">
99N/A<p class="menu">
99N/A <a href="{$path}/mod/{$index-file}">
61N/A <xsl:value-of select="$messages/message[@name='modules']" />
99N/A </a>
206N/A
206N/A <xsl:text> | </xsl:text>
206N/A
206N/A <a href="{$path}/mod/directives.html">
206N/A <xsl:value-of select="$messages/message[@name='directives']" />
206N/A </a>
206N/A
206N/A <xsl:text> | </xsl:text>
206N/A
206N/A <a href="{$path}/faq/{$index-file}">
206N/A <xsl:value-of select="$messages/message[@name='faq']" />
206N/A </a>
206N/A
206N/A <xsl:text> | </xsl:text>
206N/A
206N/A <a href="{$path}/glossary.html">
206N/A <xsl:value-of select="$messages/message[@name='glossary']" />
206N/A </a>
206N/A
206N/A <xsl:text> | </xsl:text>
206N/A
206N/A <a href="{$path}/sitemap.html">
206N/A <xsl:value-of select="$messages/message[@name='sitemap']" />
206N/A </a>
206N/A</p>
206N/A</xsl:template>
219N/A<!-- /super-menu -->
219N/A
219N/A
99N/A<!-- ==================================================================== -->
99N/A<!-- <example> -->
99N/A<!-- iterate over *all* nodes; bare text and other inline stuff is -->
99N/A<!-- wrapped into <p><code>, block level elements (defined in -->
99N/A<!-- $blockelements) are applied "as is" -->
99N/A<!-- ==================================================================== -->
206N/A<xsl:variable name="blocks"
206N/A select="concat(' ', normalize-space($blockelements), ' ')" />
206N/A
99N/A<xsl:template match="example">
99N/A<div class="example">
99N/A <xsl:apply-templates select="title" mode="print" />
99N/A
99N/A <xsl:for-each select="/node()">
99N/A <xsl:variable name="is-block-node"
99N/A select="boolean(contains($blocks,
99N/A concat(' ', local-name(), ' ')))"/>
99N/A <!-- bb = (number of) blocks nodes before (the current) -->
99N/A <xsl:variable name="bb"
99N/A select="count(preceding-sibling::*[
99N/A contains($blocks,
806N/A concat(' ', local-name(), ' '))])" />
806N/A
806N/A <xsl:if test="$is-block-node or position()=last()">
99N/A <xsl:variable name="content">
99N/A <!-- phew. short explanation, what happens here: -->
99N/A <!-- We want to get the inline stuff between the last -->
170N/A <!-- block node and the current node. -->
170N/A <!-- So filter all previous nodes for the condition -->
170N/A <!-- that the number of block nodes of all of *their* -->
99N/A <!-- previous nodes is >= $bb. Hope that helps ;-) -->
99N/A <xsl:apply-templates
61N/A select="preceding-sibling::node()[
99N/A count(preceding-sibling::*[
99N/A contains($blocks,
99N/A concat(' ', local-name(), ' '))])
99N/A &gt;= $bb]" />
99N/A
99N/A <xsl:apply-templates
99N/A select="self::node()[not($is-block-node)]" />
99N/A </xsl:variable>
176N/A
176N/A <!-- apply bare text only, if it's not only \s or empty -->
99N/A <xsl:if test="not(normalize-space($content) = '')">
99N/A <p><code>
99N/A <!-- same as $content above. xsl:copy-of seems to make -->
61N/A <!-- thread problems with xalan-j ... -->
99N/A <xsl:apply-templates
99N/A select="preceding-sibling::node()[
99N/A count(preceding-sibling::*[
99N/A contains($blocks,
99N/A concat(' ', local-name(),
99N/A ' '))])
99N/A &gt;= $bb]" />
99N/A
61N/A <xsl:apply-templates
99N/A select="self::node()[not($is-block-node)]" />
806N/A </code></p>
99N/A </xsl:if>
99N/A
99N/A <xsl:apply-templates select="self::node()[$is-block-node]" />
99N/A </xsl:if>
176N/A </xsl:for-each>
170N/A <!-- /node() -->
64N/A</div> <!-- /.example -->
62N/A</xsl:template>
64N/A<!-- /example -->
64N/A
82N/A
64N/A<!-- ==================================================================== -->
82N/A<!-- example/title -->
64N/A<!-- ==================================================================== -->
64N/A<xsl:template match="example/title" mode="print">
62N/A<h3>
62N/A <xsl:apply-templates/>
62N/A</h3>
62N/A</xsl:template>
181N/A<xsl:template match="example/title" />
206N/A<!-- /example/title -->
207N/A
206N/A
181N/A<!-- ==================================================================== -->
181N/A<!-- indentations -->
181N/A<!-- ==================================================================== -->
181N/A<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 -->
<!-- ==================================================================== -->
<!-- <related> -->
<!-- ==================================================================== -->
<xsl:template match="related">
<table class="related">
<tr>
<th>
<xsl:value-of select="$messages/message[@name='relatedmodules']" />
</th>
<th>
<xsl:value-of select="$messages/message[@name='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>
<!-- 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. -->
<xsl:choose>
<xsl:when test="@style = 'zebra'">
<xsl:for-each select="tr">
<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:for-each>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates />
</xsl:otherwise>
</xsl:choose>
</table>
</xsl:template>
<!-- /table -->
<!-- ==================================================================== -->
<!-- <ol> -->
<!-- ==================================================================== -->
<xsl:template match="ol">
<ol>
<!-- A. B. C. D. (list-style-type="upper-alpha") -->
<xsl:if test="@type = 'A'">
<xsl:attribute name="class">up-A</xsl:attribute>
</xsl:if>
<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="$messages/message[@name='transnote']" />
</em>
<xsl:text> </xsl:text>
<xsl:apply-templates />
<xsl:text>)</xsl:text>
</span>
</xsl:template>
<!-- /transnote -->
<!-- ==================================================================== -->
<!-- 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>Please fix style/xsl/common.xsl!</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>