synopsis.xsl revision 97d4d9527b64d7491543a12a3d21134b857cbe4b
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd<?xml version="1.0"?>
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd<!--
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd Licensed to the Apache Software Foundation (ASF) under one or more
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd contributor license agreements. See the NOTICE file distributed with
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd this work for additional information regarding copyright ownership.
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd The ASF licenses this file to You under the Apache License, Version 2.0
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd (the "License"); you may not use this file except in compliance with
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd the License. You may obtain a copy of the License at
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd http://www.apache.org/licenses/LICENSE-2.0
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd Unless required by applicable law or agreed to in writing, software
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd distributed under the License is distributed on an "AS IS" BASIS,
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd See the License for the specific language governing permissions and
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd limitations under the License.
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd-->
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd
4b6b68ba97661e61b45440c2e520a1fed92169e2nd<xsl:stylesheet version="1.0"
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd xmlns="http://www.w3.org/1999/xhtml">
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd<!-- ==================================================================== -->
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd<!-- <modulesynopsis> -->
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd<!-- ==================================================================== -->
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd
4930be147adf9e3f6d3ca9313a6524f9bf654b2dnd<xsl:template match="modulesynopsis">
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd<xsl:text>\section{</xsl:text>
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd<xsl:choose>
7eaf2873de4b3d99c119c9b1f0e3465ce00c0359nd <xsl:when test="/status='Core'">
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd <xsl:value-of select="$message[@id='apachecore']" />
4930be147adf9e3f6d3ca9313a6524f9bf654b2dnd </xsl:when>
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd <xsl:when test=".='mpm_common'">
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd <xsl:value-of select="$message[@id='apachempmcommon']" />
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd </xsl:when>
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd <xsl:when test="/status='MPM'">
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd <xsl:value-of select="$message[@id='apachempm']" />
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd <xsl:text> </xsl:text>
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd <xsl:apply-templates select="name"/>
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd </xsl:when>
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd <xsl:otherwise>
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd <xsl:value-of select="$message[@id='apachemodule']" />
4b6b68ba97661e61b45440c2e520a1fed92169e2nd <xsl:text> </xsl:text>
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd <xsl:apply-templates select="name"/>
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd </xsl:otherwise>
4b6b68ba97661e61b45440c2e520a1fed92169e2nd</xsl:choose>
4b6b68ba97661e61b45440c2e520a1fed92169e2nd<xsl:text>}\label{</xsl:text>
4b6b68ba97661e61b45440c2e520a1fed92169e2nd<xsl:value-of select="concat('/mod/',name)"/>
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd<xsl:text>}\hypertarget{</xsl:text>
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd<xsl:value-of select="concat('/mod/',name)"/>
4b6b68ba97661e61b45440c2e520a1fed92169e2nd<xsl:text>}{}</xsl:text>
4b6b68ba97661e61b45440c2e520a1fed92169e2nd
4b6b68ba97661e61b45440c2e520a1fed92169e2nd<xsl:text>
4b6b68ba97661e61b45440c2e520a1fed92169e2nd\begin{tabular}{lp{.75\linewidth}}
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd\hline
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd</xsl:text>
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd<xsl:value-of select="$message[@id='description']" />
4b6b68ba97661e61b45440c2e520a1fed92169e2nd<xsl:text>: &amp;</xsl:text>
6e6cc280299826341f2e79ad56134d763a54fe43nd<xsl:apply-templates select="description" />
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd<xsl:text>\\
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd</xsl:text>
4b6b68ba97661e61b45440c2e520a1fed92169e2nd
4b6b68ba97661e61b45440c2e520a1fed92169e2nd<xsl:value-of select="$message[@id='status']" />
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd<xsl:text>: &amp;</xsl:text>
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd <xsl:variable name="status" select="translate(
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd status, $uppercase, $lowercase)"/>
4b6b68ba97661e61b45440c2e520a1fed92169e2nd <xsl:value-of select="$message[@id=$status]"/>
4b6b68ba97661e61b45440c2e520a1fed92169e2nd<xsl:text>\\
f5e4573f2a3ca4b7d7d10bfb50950fa7eff27efbnilgun</xsl:text>
f5e4573f2a3ca4b7d7d10bfb50950fa7eff27efbnilgun
f5e4573f2a3ca4b7d7d10bfb50950fa7eff27efbnilgun<xsl:if test="identifier">
f5e4573f2a3ca4b7d7d10bfb50950fa7eff27efbnilgun<xsl:value-of select="$message[@id='moduleidentifier']" />
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd<xsl:text>: &amp;</xsl:text>
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd<xsl:apply-templates select="identifier" />
4b6b68ba97661e61b45440c2e520a1fed92169e2nd<xsl:text>\\
4b6b68ba97661e61b45440c2e520a1fed92169e2nd</xsl:text>
4b6b68ba97661e61b45440c2e520a1fed92169e2nd</xsl:if>
4b6b68ba97661e61b45440c2e520a1fed92169e2nd
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd<xsl:if test="sourcefile">
4b6b68ba97661e61b45440c2e520a1fed92169e2nd<xsl:value-of select="$message[@id='sourcefile']" />
4930be147adf9e3f6d3ca9313a6524f9bf654b2dnd<xsl:text>: &amp;</xsl:text>
4930be147adf9e3f6d3ca9313a6524f9bf654b2dnd<xsl:apply-templates select="sourcefile" />
4930be147adf9e3f6d3ca9313a6524f9bf654b2dnd<xsl:text>\\
4930be147adf9e3f6d3ca9313a6524f9bf654b2dnd</xsl:text>
4b6b68ba97661e61b45440c2e520a1fed92169e2nd</xsl:if>
4930be147adf9e3f6d3ca9313a6524f9bf654b2dnd
4930be147adf9e3f6d3ca9313a6524f9bf654b2dnd<xsl:if test="compatibility">
4930be147adf9e3f6d3ca9313a6524f9bf654b2dnd<xsl:value-of select="$message[@id='compatibility']" />
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd<xsl:text>: &amp;</xsl:text>
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd<xsl:apply-templates select="compatibility" />
6e6cc280299826341f2e79ad56134d763a54fe43nd<xsl:text> \\
4930be147adf9e3f6d3ca9313a6524f9bf654b2dnd</xsl:text>
4930be147adf9e3f6d3ca9313a6524f9bf654b2dnd</xsl:if>
4930be147adf9e3f6d3ca9313a6524f9bf654b2dnd<xsl:text>\hline \end{tabular}
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd</xsl:text>
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd <!-- Summary of module features/usage (1 to 3 paragraphs, -->
4b6b68ba97661e61b45440c2e520a1fed92169e2nd <!-- optional) -->
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd <xsl:if test="summary">
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd <xsl:text>\subsection*{</xsl:text>
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd <xsl:value-of select="$message[@id='summary']" />
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd <xsl:text>}
9ead22080b72dcfbf031f25179e89a7fab346f8and</xsl:text>
9ead22080b72dcfbf031f25179e89a7fab346f8and <xsl:apply-templates select="summary" />
9ead22080b72dcfbf031f25179e89a7fab346f8and </xsl:if>
6e6cc280299826341f2e79ad56134d763a54fe43nd
4b6b68ba97661e61b45440c2e520a1fed92169e2nd <xsl:text>
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd\smallskip\textbf{</xsl:text>
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd <xsl:value-of select="$message[@id='directives']" />
4b6b68ba97661e61b45440c2e520a1fed92169e2nd <xsl:text>}
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd</xsl:text>
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd
4b6b68ba97661e61b45440c2e520a1fed92169e2nd <xsl:choose>
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd <xsl:when test="directivesynopsis">
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd <xsl:text>\begin{itemize}</xsl:text>
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd <xsl:for-each select="directivesynopsis">
4b6b68ba97661e61b45440c2e520a1fed92169e2nd <xsl:sort select="name" />
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd <xsl:text>\item </xsl:text>
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd <xsl:if test="@type='section'">
4b6b68ba97661e61b45440c2e520a1fed92169e2nd <xsl:text>\textless{}</xsl:text>
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd </xsl:if>
4b6b68ba97661e61b45440c2e520a1fed92169e2nd <xsl:apply-templates select="name" mode="simple"/>
8daf1ddf6285e4ded262f7a7a8e2e983a84a3cbdhumbedooh <xsl:if test="@type='section'">
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd <xsl:text>\textgreater{}</xsl:text>
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd </xsl:if>
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd <xsl:if test="@location">
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd <xsl:variable name="lowerlocation"
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd select="translate(@location, $uppercase, $lowercase)" />
4b6b68ba97661e61b45440c2e520a1fed92169e2nd <xsl:text> (p.\ \pageref{/mod/</xsl:text>
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd <xsl:value-of select="concat(translate(@location,$uppercase,$lowercase),':',translate(name,$uppercase,$lowercase))"/>
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd <xsl:text>}) </xsl:text>
4b6b68ba97661e61b45440c2e520a1fed92169e2nd </xsl:if>
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd <xsl:text>
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd</xsl:text>
4b6b68ba97661e61b45440c2e520a1fed92169e2nd </xsl:for-each>
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd <xsl:text>\end{itemize}
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd</xsl:text>
4930be147adf9e3f6d3ca9313a6524f9bf654b2dnd </xsl:when>
4b6b68ba97661e61b45440c2e520a1fed92169e2nd <xsl:otherwise>
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd <xsl:value-of select="$message[@id='nodirectives']" />
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd <xsl:text>
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd</xsl:text>
4b6b68ba97661e61b45440c2e520a1fed92169e2nd </xsl:otherwise>
b3027c7641b1104ee50404cca6868e5101a7ca45nd </xsl:choose>
f42fe4acde21e2937220a00f5977d6e4544c8721nilgun
f42fe4acde21e2937220a00f5977d6e4544c8721nilgun <xsl:text>
f1110149b5b6c28ecc39d1958d98ad9cfa8e41f3nd</xsl:text>
f1110149b5b6c28ecc39d1958d98ad9cfa8e41f3nd
f1110149b5b6c28ecc39d1958d98ad9cfa8e41f3nd<xsl:call-template name="seealso"/>
f1110149b5b6c28ecc39d1958d98ad9cfa8e41f3nd
f1110149b5b6c28ecc39d1958d98ad9cfa8e41f3nd <!-- Sections of documentation about the module as a whole -->
f1110149b5b6c28ecc39d1958d98ad9cfa8e41f3nd <xsl:apply-templates select="section" />
f1110149b5b6c28ecc39d1958d98ad9cfa8e41f3nd
f1110149b5b6c28ecc39d1958d98ad9cfa8e41f3nd <!-- Directive documentation -->
f1110149b5b6c28ecc39d1958d98ad9cfa8e41f3nd <xsl:apply-templates select="directivesynopsis">
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd <xsl:sort select="name" />
008ab149b6efb915d8e0034c0b8266f8c3e3f872nd </xsl:apply-templates>
</xsl:template>
<!-- /modulesynopsis -->
<!-- ==================================================================== -->
<!-- Directivesynopsis -->
<!-- ==================================================================== -->
<xsl:template match="directivesynopsis/name" mode="simple" name="simpledirname">
<xsl:if test="@type='section'"><xsl:text>\textless{}</xsl:text></xsl:if>
<xsl:apply-templates/>
<xsl:if test="@type='section'"><xsl:text>\textgreater{}</xsl:text></xsl:if>
</xsl:template>
<xsl:template match="directivesynopsis/name">
<xsl:text>\subsection*{</xsl:text>
<xsl:call-template name="simpledirname"/>
<xsl:choose>
<xsl:when test="$message[@id='directive']/@replace-space-with">
<xsl:value-of select="$message[@id='directive']/@replace-space-with"/>
</xsl:when>
<xsl:otherwise>
<xsl:text> </xsl:text>
</xsl:otherwise>
</xsl:choose>
<xsl:value-of select="$message[@id='directive']" />
<xsl:text>}\label{</xsl:text>
<xsl:value-of select="concat('/mod/', //modulesynopsis/name, ':', translate(., $uppercase, $lowercase))"/>
<xsl:text>}\hypertarget{</xsl:text>
<xsl:value-of select="concat('/mod/', //modulesynopsis/name, ':', translate(., $uppercase, $lowercase))"/>
<xsl:text>}{}</xsl:text>
</xsl:template>
<xsl:template match="directivesynopsis">
<xsl:if test="not(@location)">
<xsl:apply-templates select="name"/>
<!-- Directive header -->
<xsl:text>
\begin{tabular}{lp{.8\linewidth}}
\hline
</xsl:text>
<xsl:value-of select="$message[@id='description']" />
<xsl:text>: &amp; </xsl:text>
<xsl:apply-templates select="description" />
<xsl:text>\\
</xsl:text>
<xsl:value-of select="$message[@id='syntax']" />
<xsl:text>: &amp; {\ttfamily </xsl:text>
<xsl:apply-templates select="syntax" mode="tabular" />
<xsl:text>}\\
</xsl:text>
<xsl:if test="default">
<xsl:value-of select="$message[@id='default']" />
<xsl:text>: &amp; {\ttfamily </xsl:text>
<xsl:apply-templates select="default" />
<xsl:text>} \\
</xsl:text>
</xsl:if>
<xsl:value-of select="$message[@id='context']" />
<xsl:text>: &amp;</xsl:text>
<xsl:apply-templates select="contextlist" />
<xsl:text> \\
</xsl:text>
<xsl:if test="override">
<xsl:value-of select="$message[@id='override']"/>
<xsl:text>: &amp;</xsl:text>
<xsl:apply-templates select="override" />
<xsl:text> \\
</xsl:text>
</xsl:if>
<xsl:value-of select="$message[@id='status']" />
<xsl:text>: &amp;</xsl:text>
<xsl:variable name="status" select="translate(
/status, $uppercase, $lowercase)"/>
<xsl:value-of select="$message[@id=$status]"/>
<xsl:text> \\
</xsl:text>
<xsl:value-of select="$message[@id='module']" />
<xsl:text>: &amp;</xsl:text>
<xsl:choose>
<xsl:when test="modulelist">
<xsl:apply-templates select="modulelist" />
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="/name" />
</xsl:otherwise>
</xsl:choose>
<xsl:text> \\
</xsl:text>
<xsl:if test="compatibility">
<xsl:value-of select="$message[@id='compatibility']" />
<xsl:text>: &amp;</xsl:text>
<xsl:apply-templates select="compatibility" />
<xsl:text> \\
</xsl:text>
</xsl:if>
<xsl:text>\hline
\end{tabular}
</xsl:text>
<xsl:apply-templates select="usage" />
<xsl:call-template name="seealso"/>
</xsl:if> <!-- /not(@location) -->
</xsl:template>
<!-- /directivesynopsis -->
<!-- ==================================================================== -->
<!-- <contextlist> -->
<!-- ==================================================================== -->
<xsl:template match="contextlist">
<xsl:apply-templates select="context" />
</xsl:template>
<!-- /contextlist -->
<!-- ==================================================================== -->
<!-- <context> -->
<!-- Each entry is separeted with a comma -->
<!-- ==================================================================== -->
<xsl:template match="context">
<xsl:choose>
<xsl:when test="normalize-space(.) = 'server config'">
<xsl:value-of select="$message[@id='serverconfig']" />
</xsl:when>
<xsl:when test="normalize-space(.) = 'virtual host'">
<xsl:value-of select="$message[@id='virtualhost']" />
</xsl:when>
<xsl:when test="normalize-space(.) = 'directory'">
<xsl:value-of select="$message[@id='directory']" />
</xsl:when>
<xsl:when test="normalize-space(.) = '.htaccess'">
<xsl:value-of select="$message[@id='htaccess']" />
</xsl:when>
<xsl:otherwise> <!-- error -->
<xsl:message terminate="yes">
unknown context: <xsl:value-of select="." />
</xsl:message>
</xsl:otherwise>
</xsl:choose>
<xsl:if test="position() != last()">
<xsl:text>, </xsl:text>
</xsl:if>
</xsl:template>
<!-- /context -->
<!-- ==================================================================== -->
<!-- <modulelist> -->
<!-- ==================================================================== -->
<xsl:template match="modulelist">
<xsl:for-each select="module">
<xsl:call-template name="module" />
<xsl:if test="position() != last()">
<xsl:text>, </xsl:text>
</xsl:if>
</xsl:for-each>
</xsl:template>
<!-- /modulelist -->
<!-- ==================================================================== -->
<!-- modulesynopsis/compatibility -->
<!-- ==================================================================== -->
<xsl:template match="modulesynopsis/compatibility">
<xsl:apply-templates />
</xsl:template>
<!-- ==================================================================== -->
<!-- directivesynopsis/compatibility -->
<!-- ==================================================================== -->
<xsl:template match="directivesynopsis/compatibility">
<xsl:apply-templates />
</xsl:template>
</xsl:stylesheet>