common.xsl revision 9a1b062f73a4a085af8fe41fae402aaee41d33cc
6ca0e6973c8176100f4a426444823ae5e777e28fsascha<?xml version="1.0"?>
06924437019f9871bc4ee49748511130548b7d35rbb<!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#160;"> ]>
6ca0e6973c8176100f4a426444823ae5e777e28fsascha<xsl:stylesheet version="1.0"
6e24b94d1e7122e128d9c19b3dff0e49475f5d37rbb xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
6ca0e6973c8176100f4a426444823ae5e777e28fsascha xmlns="http://www.w3.org/1999/xhtml">
6ca0e6973c8176100f4a426444823ae5e777e28fsascha
6ca0e6973c8176100f4a426444823ae5e777e28fsascha <!-- -->
6ca0e6973c8176100f4a426444823ae5e777e28fsascha <!-- Please, don't hard-code output strings! Use the language -->
6ca0e6973c8176100f4a426444823ae5e777e28fsascha <!-- files and the translation "stuff"... -->
6ca0e6973c8176100f4a426444823ae5e777e28fsascha <!-- -->
a3658aa5c00f07bf898d46fdddae880c52424872sascha
6ca0e6973c8176100f4a426444823ae5e777e28fsascha <!-- Constants used for case translation -->
6687a315a676cbcb8063a8477a579876d82ab327gstein <xsl:variable name="lowercase" select="'abcdefghijklmnopqrstuvwxyz'" />
6ca0e6973c8176100f4a426444823ae5e777e28fsascha <xsl:variable name="uppercase" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'" />
6ca0e6973c8176100f4a426444823ae5e777e28fsascha
6ca0e6973c8176100f4a426444823ae5e777e28fsascha <!--
0b483bc2a16712efe6aa95e06a57ec2c1cb956c7sascha space separated list of blockelements defined in common.dtd
21609e0ec0c954bc03e15039b472c5d687c329cftrawick used for inline content catching in <example>s
2a67190265146d3e80b1b0c9ef04f181c8db7f64rbb -->
bc26992c7172dff00bc89fbfb5f0c6e3c4d6a261rbb <xsl:variable name="blockelements">
bc26992c7172dff00bc89fbfb5f0c6e3c4d6a261rbb p example note table ul ol dl pre img blockquote
bc26992c7172dff00bc89fbfb5f0c6e3c4d6a261rbb </xsl:variable>
6ca0e6973c8176100f4a426444823ae5e777e28fsascha
2795c373a9fb112dc77576c1dfc23119f02d598amanoj <!-- relative path to /manual/ -->
2795c373a9fb112dc77576c1dfc23119f02d598amanoj <xsl:variable name="path">
6ca0e6973c8176100f4a426444823ae5e777e28fsascha <xsl:choose>
6ca0e6973c8176100f4a426444823ae5e777e28fsascha <xsl:when test="*/relativepath/@href">
6ca0e6973c8176100f4a426444823ae5e777e28fsascha <xsl:value-of select="*/relativepath/@href"/>
7bfe076b680e6e591add6cdc754ce9a6910682a2sascha </xsl:when>
6ca0e6973c8176100f4a426444823ae5e777e28fsascha <xsl:otherwise>
6ca0e6973c8176100f4a426444823ae5e777e28fsascha <xsl:value-of select="'..'"/>
6ca0e6973c8176100f4a426444823ae5e777e28fsascha </xsl:otherwise>
6ca0e6973c8176100f4a426444823ae5e777e28fsascha </xsl:choose>
6ca0e6973c8176100f4a426444823ae5e777e28fsascha </xsl:variable>
6ca0e6973c8176100f4a426444823ae5e777e28fsascha
6a1c919219ae7e3382fb22f1c4cf89f11b4becffcoar <!-- load outsourced page types -->
6ca0e6973c8176100f4a426444823ae5e777e28fsascha <xsl:include href="moduleindex.xsl"/>
6ca0e6973c8176100f4a426444823ae5e777e28fsascha <xsl:include href="directiveindex.xsl"/>
6ca0e6973c8176100f4a426444823ae5e777e28fsascha <xsl:include href="manualpage.xsl"/>
46a06e5f359747d9b673ea77fcef89a851192e18rbb <xsl:include href="synopsis.xsl"/>
46a06e5f359747d9b673ea77fcef89a851192e18rbb <xsl:include href="sitemap.xsl"/>
46a06e5f359747d9b673ea77fcef89a851192e18rbb <xsl:include href="quickreference.xsl"/>
6ca0e6973c8176100f4a426444823ae5e777e28fsascha
6ca0e6973c8176100f4a426444823ae5e777e28fsascha <!-- make sure, we set relative anchors
6ca0e6973c8176100f4a426444823ae5e777e28fsascha only, if we're actually transforming
6ca0e6973c8176100f4a426444823ae5e777e28fsascha a modulefile (see <directive>) -->
6ca0e6973c8176100f4a426444823ae5e777e28fsascha <xsl:variable name="in-modulesynopsis"><xsl:choose>
02a2457c82c9f4e5e95e6e97d249e8a20c4154d6sascha <xsl:when test="/quickreference">0</xsl:when>
de2aecd8da21eeae4394088cca196dfcb491de84rbb
26d4668b602c703d63655271b1caaa420bf7a572rbb <xsl:otherwise>1</xsl:otherwise></xsl:choose>
26d4668b602c703d63655271b1caaa420bf7a572rbb </xsl:variable>
26d4668b602c703d63655271b1caaa420bf7a572rbb
26d4668b602c703d63655271b1caaa420bf7a572rbb <!-- -->
6ca0e6973c8176100f4a426444823ae5e777e28fsascha <!-- Utility templates for constructing pages -->
6ca0e6973c8176100f4a426444823ae5e777e28fsascha <!-- -->
7bfe076b680e6e591add6cdc754ce9a6910682a2sascha
02a2457c82c9f4e5e95e6e97d249e8a20c4154d6sascha
6ca0e6973c8176100f4a426444823ae5e777e28fsascha <!-- -->
6ca0e6973c8176100f4a426444823ae5e777e28fsascha <!-- HTML head -->
6ca0e6973c8176100f4a426444823ae5e777e28fsascha <!-- -->
7bfe076b680e6e591add6cdc754ce9a6910682a2sascha <xsl:template name="head">
87193a6150fcb830b68d79fdbb3f068cb3724677sascha <head>
6ca0e6973c8176100f4a426444823ae5e777e28fsascha <xsl:comment>
6ca0e6973c8176100f4a426444823ae5e777e28fsascha XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
6ca0e6973c8176100f4a426444823ae5e777e28fsascha This file is generated from xml source: DO NOT EDIT
7bfe076b680e6e591add6cdc754ce9a6910682a2sascha XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
87193a6150fcb830b68d79fdbb3f068cb3724677sascha </xsl:comment>
2a67190265146d3e80b1b0c9ef04f181c8db7f64rbb
2a67190265146d3e80b1b0c9ef04f181c8db7f64rbb <title>
2a67190265146d3e80b1b0c9ef04f181c8db7f64rbb <xsl:choose>
7bfe076b680e6e591add6cdc754ce9a6910682a2sascha <xsl:when test="name">
87193a6150fcb830b68d79fdbb3f068cb3724677sascha <xsl:value-of select="name"/>
87193a6150fcb830b68d79fdbb3f068cb3724677sascha </xsl:when>
87193a6150fcb830b68d79fdbb3f068cb3724677sascha
87193a6150fcb830b68d79fdbb3f068cb3724677sascha <xsl:otherwise>
87193a6150fcb830b68d79fdbb3f068cb3724677sascha <xsl:value-of select="title"/>
87193a6150fcb830b68d79fdbb3f068cb3724677sascha </xsl:otherwise>
0b483bc2a16712efe6aa95e06a57ec2c1cb956c7sascha </xsl:choose>
6ca0e6973c8176100f4a426444823ae5e777e28fsascha
7bfe076b680e6e591add6cdc754ce9a6910682a2sascha <xsl:text> </xsl:text>
6cb7893a671cebe32dd0455ba79781a4834e141egregames <xsl:value-of select="$messages/message[@name='apachetitle']"/>
6cb7893a671cebe32dd0455ba79781a4834e141egregames </title>
6cb7893a671cebe32dd0455ba79781a4834e141egregames <link title="Main stylesheet" type="text/css" media="all" rel="stylesheet"
6cb7893a671cebe32dd0455ba79781a4834e141egregames href="{$path}/style/css/manual.css" />
6cb7893a671cebe32dd0455ba79781a4834e141egregames <link title="No Sidebar - Default font size" type="text/css" media="all"
6cb7893a671cebe32dd0455ba79781a4834e141egregames rel="alternate stylesheet"
6ca0e6973c8176100f4a426444823ae5e777e28fsascha href="{$path}/style/css/manual-loose-100pc.css"/>
6ca0e6973c8176100f4a426444823ae5e777e28fsascha <link type="text/css" media="print"
6ca0e6973c8176100f4a426444823ae5e777e28fsascha rel="stylesheet"
7bfe076b680e6e591add6cdc754ce9a6910682a2sascha href="{$path}/style/css/manual-print.css"/>
7bfe076b680e6e591add6cdc754ce9a6910682a2sascha
7bfe076b680e6e591add6cdc754ce9a6910682a2sascha <link rel="shortcut icon" href="{$path}/images/favicon.ico" />
87193a6150fcb830b68d79fdbb3f068cb3724677sascha </head>
bbd84c2a95afbca61ef7897e2fb8e897e4682f9drbb </xsl:template>
b53eaa68ccc40475cbb2af34ab0e342223b76dd6rbb <!-- /head -->
156e4036ec6e4b5d858025a1af72403c0eb15d9adreid
156e4036ec6e4b5d858025a1af72403c0eb15d9adreid
b6d830878cedf541e64b399766a38ffc5d8edf05gstein <!-- -->
87193a6150fcb830b68d79fdbb3f068cb3724677sascha <!-- page top -->
87193a6150fcb830b68d79fdbb3f068cb3724677sascha <!-- -->
6ca0e6973c8176100f4a426444823ae5e777e28fsascha <xsl:template name="top">
<div id="page-header">
<xsl:call-template name="super-menu" />
<p class="apache">
<xsl:value-of select="$messages/message[@name='apachehttpserver']"/>
</p>
<img src="{$path}/images/feather.gif" alt="" />
</div> <!-- /page-header -->
<div class="up">
<a href="./"><img src="{$path}/images/left.gif" alt="&lt;-" title="&lt;-" /></a>
</div>
<div id="path">
<!-- XXX: choose just for now, so it works until the
translations are done! -->
<xsl:choose>
<xsl:when test="$messages/message[@name='maintainedby']">
<a href="http://www.apache.org/">
<xsl:value-of select="$messages/message[@name='apache']"/>
</a>
<xsl:text> &gt; </xsl:text>
<a href="http://httpd.apache.org/">
<xsl:value-of select="$messages/message[@name='http-server']"/>
</a>
<xsl:text> &gt; </xsl:text>
<a href="http://httpd.apache.org/docs-project/">
<xsl:value-of select="$messages/message[@name='documentation']"/>
</a>
<xsl:text> &gt; </xsl:text>
<a href="{$path}/">
<xsl:value-of select="$messages/message[@name='version']"/>
</a>
<xsl:if test="/modulesynopsis or /directiveindex">
<xsl:text> &gt; </xsl:text>
<a href="./">
<xsl:value-of select="$messages/message[@name='modules']"/>
</a>
</xsl:if>
</xsl:when>
<xsl:otherwise>
<a href="http://www.apache.org/">Apache</a>
<xsl:text> &gt; </xsl:text>
<a href="http://httpd.apache.org/">HTTP Server</a>
<xsl:text> &gt; </xsl:text>
<a href="http://httpd.apache.org/docs-project/">Documentation</a>
<xsl:text> &gt; </xsl:text>
<a href="{$path}/">Version 2.0</a>
<xsl:if test="/modulesynopsis or /directiveindex">
<xsl:text> &gt; </xsl:text>
<a href="./">Modules</a>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</div> <!-- /path -->
</xsl:template>
<!-- /top -->
<!-- -->
<!-- page bottom -->
<!-- -->
<xsl:template name="bottom">
<div id="footer">
<p class="apache">
<!-- XXX: choose just for now, so it works until the
translations are done! -->
<xsl:choose>
<xsl:when test="$messages/message[@name='maintainedby']">
<xsl:value-of select="$messages/message[@name='maintainedby']"/>
</xsl:when>
<xsl:otherwise>
<xsl:text>Maintained by the</xsl:text>
</xsl:otherwise>
</xsl:choose>
<xsl:text> </xsl:text>
<a href="http://httpd.apache.org/docs-project/">Apache HTTP Server Documentation Project</a>
</p>
<xsl:call-template name="super-menu"/>
</div> <!-- /footer -->
</xsl:template>
<!-- /bottom -->
<!-- -->
<!-- Process a documentation section -->
<!-- -->
<xsl:template match="section">
<xsl:call-template name="toplink"/>
<div class="section">
<!-- Section heading -->
<h2>
<xsl:if test="@id">
<a id="{@id}" name="{@id}">
<xsl:apply-templates select="title" mode="print"/>
</a>
</xsl:if>
<xsl:if test="not(@id)">
<xsl:apply-templates select="title" mode="print"/>
</xsl:if>
</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:if test="@id">
<a id="{@id}" name="{@id}">
<xsl:apply-templates select="title" mode="print"/>
</a>
</xsl:if>
<xsl:if test="not(@id)">
<xsl:apply-templates select="title" mode="print"/>
</xsl:if>
</h3>
<!-- Section body -->
<xsl:apply-templates/>
</xsl:template>
<!-- /section/section -->
<!-- -->
<!-- (sub)section titles -->
<!-- -->
<xsl:template match="section/title" mode="print">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="section/title">
<!-- Don't print the title twice -->
</xsl:template>
<!-- /section/title -->
<!-- -->
<!-- generate section index -->
<!-- -->
<xsl:template match="section" mode="index">
<xsl:if test="@id">
<li>
<img src="{$path}/images/down.gif" alt="" />
<xsl:text> </xsl:text>
<a href="#{@id}">
<xsl:apply-templates select="title" mode="print"/>
</a>
</li>
</xsl:if>
<xsl:if test="not(@id)">
<li>
<img src="{$path}/images/down.gif" alt="" />
<xsl:text> </xsl:text>
<xsl:apply-templates select="title" mode="print"/>
<!-- nested sections -->
<!-- NOT FOR NOW -->
<!--
<xsl:if test="section">
<ul>
<xsl:apply-templates select="section" mode="index"/>
</ul>
</xsl:if>
-->
</li>
</xsl:if>
</xsl:template>
<!-- /section index -->
<!-- -->
<!-- docs super menu -->
<!-- -->
<xsl:template name="super-menu">
<p class="menu">
<!-- XXX: choose just for now, so it works until the
translations are done! -->
<xsl:choose>
<xsl:when test="$messages/message[@name='maintainedby']">
<a href="{$path}/mod/">
<xsl:value-of select="$messages/message[@name='modules']"/>
</a>
<xsl:text> | </xsl:text>
<a href="{$path}/mod/directives.html">
<xsl:value-of select="$messages/message[@name='directives']"/>
</a>
<xsl:text> | </xsl:text>
<a href="{$path}/faq/">
<xsl:value-of select="$messages/message[@name='faq']"/>
</a>
<xsl:text> | </xsl:text>
<a href="{$path}/glossary.html">
<xsl:value-of select="$messages/message[@name='glossary']"/>
</a>
<xsl:text> | </xsl:text>
<a href="{$path}/sitemap.html">
<xsl:value-of select="$messages/message[@name='sitemap']"/>
</a>
</xsl:when>
<xsl:otherwise>
<a href="{$path}/mod/">Modules</a>
<xsl:text> | </xsl:text>
<a href="{$path}/mod/directives.html">Directives</a>
<xsl:text> | </xsl:text>
<a href="{$path}/faq/">FAQ</a>
<xsl:text> | </xsl:text>
<a href="{$path}/glossary.html">Glossary</a>
<xsl:text> | </xsl:text>
<a href="{$path}/sitemap.html">Sitemap</a>
</xsl:otherwise>
</xsl:choose>
</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(),' ')))"/>
<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">
<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="normalize-space($content) != ''">
<p><code>
<xsl:copy-of select="$content"/>
</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">
<!-- don't print twice -->
</xsl:template>
<!-- /example/title -->
<!-- -->
<!-- <note> -->
<!-- Notes are placed in a table. Uses different back- -->
<!-- ground colors, depending on type of note. -->
<!-- -->
<xsl:template match="note">
<xsl:choose>
<xsl:when test="@type='warning'">
<div class="warning">
<xsl:apply-templates/>
</div>
</xsl:when>
<xsl:otherwise>
<div class="note">
<xsl:apply-templates/>
</div>
</xsl:otherwise>
</xsl:choose>
</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:if test="@module">
<xsl:variable name="lowerdirective" select="translate(., $uppercase, $lowercase)"/>
<xsl:choose>
<xsl:when test="$in-modulesynopsis = '1' 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:if>
<xsl:if test="not(@module)">
<xsl:if test="@type='section'">&lt;</xsl:if>
<xsl:value-of select="."/>
<xsl:if test="@type='section'">&gt;</xsl:if>
</xsl:if>
</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 -->
<xsl:template match="related/modulelist">
<xsl:for-each select="module">
<li>
<xsl:call-template name="module"/>
</li>
</xsl:for-each>
</xsl:template>
<xsl:template match="related/directivelist">
<xsl:for-each select="directive">
<li>
<xsl:call-template name="directive"/>
</li>
</xsl:for-each>
</xsl:template>
<!-- -->
<!-- <table border> -->
<!-- -->
<xsl:template match="table">
<xsl:if test="@border">
<table class="bordered">
<xsl:apply-templates/>
</table>
</xsl:if>
<xsl:if test="not(@border)">
<table>
<xsl:apply-templates/>
</table>
</xsl:if>
</xsl:template>
<!-- /table border -->
<!-- -->
<!-- <ol type -->
<!-- -->
<xsl:template match="ol">
<xsl:if test="@type = 'A'">
<ol class="up-A">
<xsl:apply-templates/>
</ol>
</xsl:if>
<xsl:if test="not(@type)">
<ol>
<xsl:apply-templates/>
</ol>
</xsl:if>
</xsl:template>
<!-- /ol type -->
<!-- -->
<!-- <summary> -->
<!-- Passes through content -->
<!-- -->
<xsl:template match="summary">
<xsl:apply-templates/>
</xsl:template>
<!-- /summary -->
<!-- -->
<!-- <description> -->
<!-- Passes through content -->
<!-- -->
<xsl:template match="description">
<xsl:apply-templates/>
</xsl:template>
<!-- /description -->
<!-- -->
<!-- <usage> -->
<!-- Passes through content -->
<!-- -->
<xsl:template match="usage">
<xsl:apply-templates/>
</xsl:template>
<!-- /usage -->
<!-- -->
<!-- <syntax> -->
<!-- Passes through content -->
<!-- -->
<xsl:template match="syntax">
<xsl:apply-templates/>
</xsl:template>
<!-- /syntax -->
<!-- -->
<!-- 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 -->
<!-- -->
<!-- Process everything else by just passing it through -->
<!-- -->
<xsl:template match="*|@*">
<xsl:copy>
<xsl:apply-templates select="@*|*|text()"/>
</xsl:copy>
</xsl:template>
<!-- -->
<!-- create a letter bar -->
<!-- used in several documents -->
<!-- -->
<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)}">
<xsl:text>&nbsp;</xsl:text>
<xsl:value-of select="substring($letters,1,1)"/>
<xsl:text>&nbsp;</xsl:text>
</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>
<!-- -->
<!-- template(s) for collecting all start letters -->
<!-- of directives -->
<!-- used in several documents -->
<!-- -->
<xsl:template name="directive-startletters">
<xsl:call-template name="_squeeze-letters">
<xsl:with-param name="lastletter" select="''"/>
<xsl:with-param name="letters">
<xsl:for-each select="document(/*/modulefilelist/modulefile)/modulesynopsis/directivesynopsis[not(@location)]">
<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>
<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="$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>
</xsl:stylesheet>