synopsis.xsl revision a7835c7a8cf86045fdaee65dc2839bfe6314fb1e
1d363c6830b1389bb442b3110e1b803f2a69c979slive<?xml version="1.0"?>
1d363c6830b1389bb442b3110e1b803f2a69c979slive
1d363c6830b1389bb442b3110e1b803f2a69c979slive<!--
5f5d1b4cc970b7f06ff8ef6526128e9a27303d88nd Copyright 2003-2004 Apache Software Foundation
1d363c6830b1389bb442b3110e1b803f2a69c979slive
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd Licensed under the Apache License, Version 2.0 (the "License");
6fbd2e53c97ea6976d93e0ac521adabc55e0fb73nd you may not use this file except in compliance with the License.
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd You may obtain a copy of the License at
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd http://www.apache.org/licenses/LICENSE-2.0
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd Unless required by applicable law or agreed to in writing, software
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd distributed under the License is distributed on an "AS IS" BASIS,
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd See the License for the specific language governing permissions and
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd limitations under the License.
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd-->
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd<xsl:stylesheet version="1.0"
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd xmlns="http://www.w3.org/1999/xhtml">
7db9f691a00ead175b03335457ca296a33ddf31bnd
1d363c6830b1389bb442b3110e1b803f2a69c979slive
1d363c6830b1389bb442b3110e1b803f2a69c979slive<!-- ==================================================================== -->
1d363c6830b1389bb442b3110e1b803f2a69c979slive<!-- <modulesynopsis> -->
1d363c6830b1389bb442b3110e1b803f2a69c979slive<!-- ==================================================================== -->
1d363c6830b1389bb442b3110e1b803f2a69c979slive
1d363c6830b1389bb442b3110e1b803f2a69c979slive<xsl:template match="modulesynopsis">
1d363c6830b1389bb442b3110e1b803f2a69c979slive
1d363c6830b1389bb442b3110e1b803f2a69c979slive<xsl:text>\section{</xsl:text>
1d363c6830b1389bb442b3110e1b803f2a69c979slive<xsl:choose>
1d363c6830b1389bb442b3110e1b803f2a69c979slive <xsl:when test="/status='Core'">
1d363c6830b1389bb442b3110e1b803f2a69c979slive <xsl:value-of select="$messages/message [@name='apachecore']" />
1d363c6830b1389bb442b3110e1b803f2a69c979slive </xsl:when>
1d363c6830b1389bb442b3110e1b803f2a69c979slive <xsl:when test=".='mpm_common'">
1d363c6830b1389bb442b3110e1b803f2a69c979slive <xsl:value-of select="$messages/message [@name='apachempmcommon']" />
1d363c6830b1389bb442b3110e1b803f2a69c979slive </xsl:when>
1d363c6830b1389bb442b3110e1b803f2a69c979slive <xsl:when test="/status='MPM'">
1d363c6830b1389bb442b3110e1b803f2a69c979slive <xsl:value-of select="$messages/message [@name='apachempm']" />
1d363c6830b1389bb442b3110e1b803f2a69c979slive <xsl:text> </xsl:text>
1d363c6830b1389bb442b3110e1b803f2a69c979slive <xsl:apply-templates select="name"/>
1d363c6830b1389bb442b3110e1b803f2a69c979slive </xsl:when>
1d363c6830b1389bb442b3110e1b803f2a69c979slive <xsl:otherwise>
1d363c6830b1389bb442b3110e1b803f2a69c979slive <xsl:value-of select="$messages/message [@name='apachemodule']" />
1d363c6830b1389bb442b3110e1b803f2a69c979slive <xsl:text> </xsl:text>
1d363c6830b1389bb442b3110e1b803f2a69c979slive <xsl:apply-templates select="name"/>
1d363c6830b1389bb442b3110e1b803f2a69c979slive </xsl:otherwise>
1d363c6830b1389bb442b3110e1b803f2a69c979slive</xsl:choose>
1d363c6830b1389bb442b3110e1b803f2a69c979slive<xsl:text>}\label{</xsl:text>
1d363c6830b1389bb442b3110e1b803f2a69c979slive<xsl:value-of select="concat('/mod/',name)"/>
1d363c6830b1389bb442b3110e1b803f2a69c979slive<xsl:text>}\hypertarget{</xsl:text>
1d363c6830b1389bb442b3110e1b803f2a69c979slive<xsl:value-of select="concat('/mod/',name)"/>
1d363c6830b1389bb442b3110e1b803f2a69c979slive<xsl:text>}{}</xsl:text>
1d363c6830b1389bb442b3110e1b803f2a69c979slive
1d363c6830b1389bb442b3110e1b803f2a69c979slive<xsl:text>
1d363c6830b1389bb442b3110e1b803f2a69c979slive\begin{tabular}{lp{.75\linewidth}}
1d363c6830b1389bb442b3110e1b803f2a69c979slive\hline
1d363c6830b1389bb442b3110e1b803f2a69c979slive</xsl:text>
1d363c6830b1389bb442b3110e1b803f2a69c979slive<xsl:value-of select="$messages/message [@name='description']" />
1d363c6830b1389bb442b3110e1b803f2a69c979slive<xsl:text>: &amp;</xsl:text>
1d363c6830b1389bb442b3110e1b803f2a69c979slive<xsl:apply-templates select="description" />
1d363c6830b1389bb442b3110e1b803f2a69c979slive<xsl:text>\\
1d363c6830b1389bb442b3110e1b803f2a69c979slive</xsl:text>
1d363c6830b1389bb442b3110e1b803f2a69c979slive
1d363c6830b1389bb442b3110e1b803f2a69c979slive<xsl:value-of select="$messages/message [@name='status']" />
1d363c6830b1389bb442b3110e1b803f2a69c979slive<xsl:text>: &amp;</xsl:text>
1d363c6830b1389bb442b3110e1b803f2a69c979slive<xsl:value-of select="status" />
1d363c6830b1389bb442b3110e1b803f2a69c979slive<xsl:text>\\
1d363c6830b1389bb442b3110e1b803f2a69c979slive</xsl:text>
1d363c6830b1389bb442b3110e1b803f2a69c979slive
1d363c6830b1389bb442b3110e1b803f2a69c979slive<xsl:if test="identifier">
1d363c6830b1389bb442b3110e1b803f2a69c979slive<xsl:value-of select="$messages/message [@name='moduleidentifier']" />
1d363c6830b1389bb442b3110e1b803f2a69c979slive<xsl:text>: &amp;</xsl:text>
1d363c6830b1389bb442b3110e1b803f2a69c979slive<xsl:apply-templates select="identifier" />
1d363c6830b1389bb442b3110e1b803f2a69c979slive<xsl:text>\\
1d363c6830b1389bb442b3110e1b803f2a69c979slive</xsl:text>
1d363c6830b1389bb442b3110e1b803f2a69c979slive</xsl:if>
1d363c6830b1389bb442b3110e1b803f2a69c979slive
1d363c6830b1389bb442b3110e1b803f2a69c979slive<xsl:if test="sourcefile">
1d363c6830b1389bb442b3110e1b803f2a69c979slive<xsl:value-of select="$messages/message [@name='sourcefile']" />
1d363c6830b1389bb442b3110e1b803f2a69c979slive<xsl:text>: &amp;</xsl:text>
1d363c6830b1389bb442b3110e1b803f2a69c979slive<xsl:apply-templates select="sourcefile" />
1d363c6830b1389bb442b3110e1b803f2a69c979slive<xsl:text>\\
1d363c6830b1389bb442b3110e1b803f2a69c979slive</xsl:text>
1d363c6830b1389bb442b3110e1b803f2a69c979slive</xsl:if>
1d363c6830b1389bb442b3110e1b803f2a69c979slive
1d363c6830b1389bb442b3110e1b803f2a69c979slive<xsl:if test="compatibility">
1d363c6830b1389bb442b3110e1b803f2a69c979slive<xsl:value-of select="$messages/message [@name='compatibility']" />
1d363c6830b1389bb442b3110e1b803f2a69c979slive<xsl:text>: &amp;</xsl:text>
1d363c6830b1389bb442b3110e1b803f2a69c979slive<xsl:apply-templates select="compatibility" />
1d363c6830b1389bb442b3110e1b803f2a69c979slive<xsl:text> \\
1d363c6830b1389bb442b3110e1b803f2a69c979slive</xsl:text>
1d363c6830b1389bb442b3110e1b803f2a69c979slive</xsl:if>
1d363c6830b1389bb442b3110e1b803f2a69c979slive<xsl:text>\hline \end{tabular}
1d363c6830b1389bb442b3110e1b803f2a69c979slive</xsl:text>
1d363c6830b1389bb442b3110e1b803f2a69c979slive <!-- Summary of module features/usage (1 to 3 paragraphs, -->
1d363c6830b1389bb442b3110e1b803f2a69c979slive <!-- optional) -->
1d363c6830b1389bb442b3110e1b803f2a69c979slive <xsl:if test="summary">
1d363c6830b1389bb442b3110e1b803f2a69c979slive <xsl:text>\subsection*{</xsl:text>
1d363c6830b1389bb442b3110e1b803f2a69c979slive <xsl:value-of select="$messages/message [@name='summary']" />
1d363c6830b1389bb442b3110e1b803f2a69c979slive <xsl:text>}
1d363c6830b1389bb442b3110e1b803f2a69c979slive</xsl:text>
1d363c6830b1389bb442b3110e1b803f2a69c979slive <xsl:apply-templates select="summary" />
1d363c6830b1389bb442b3110e1b803f2a69c979slive </xsl:if>
1d363c6830b1389bb442b3110e1b803f2a69c979slive
7db9f691a00ead175b03335457ca296a33ddf31bnd <xsl:text>
\smallskip\textbf{</xsl:text>
<xsl:value-of select="$messages/message [@name='directives']" />
<xsl:text>}
</xsl:text>
<xsl:choose>
<xsl:when test="directivesynopsis">
<xsl:text>\begin{itemize}</xsl:text>
<xsl:for-each select="directivesynopsis">
<xsl:sort select="name" />
<xsl:text>\item </xsl:text>
<xsl:if test="@type='section'">
<xsl:text>\textless{}</xsl:text>
</xsl:if>
<xsl:apply-templates select="name" mode="simple"/>
<xsl:if test="@type='section'">
<xsl:text>\textgreater{}</xsl:text>
</xsl:if>
<xsl:if test="@location">
<xsl:variable name="lowerlocation"
select="translate(@location, $uppercase, $lowercase)" />
<xsl:text> (p.\ \pageref{/mod/</xsl:text>
<xsl:value-of select="concat(translate(@location,$uppercase,$lowercase),':',translate(name,$uppercase,$lowercase))"/>
<xsl:text>}) </xsl:text>
</xsl:if>
<xsl:text>
</xsl:text>
</xsl:for-each>
<xsl:text>\end{itemize}
</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$messages/message [@name='nodirectives']" />
<xsl:text>
</xsl:text>
</xsl:otherwise>
</xsl:choose>
<xsl:text>
</xsl:text>
<xsl:call-template name="seealso"/>
<!-- Sections of documentation about the module as a whole -->
<xsl:apply-templates select="section" />
<!-- Directive documentation -->
<xsl:apply-templates select="directivesynopsis">
<xsl:sort select="name" />
</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="$messages/message
[@name='directive']/@replace-space-with">
<xsl:value-of select="$messages/message
[@name='directive']/@replace-space-with"/>
</xsl:when>
<xsl:otherwise>
<xsl:text> </xsl:text>
</xsl:otherwise>
</xsl:choose>
<xsl:value-of select="$messages/message[@name='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="$messages/message [@name='description']" />
<xsl:text>: &amp; </xsl:text>
<xsl:apply-templates select="description" />
<xsl:text>\\
</xsl:text>
<xsl:value-of select="$messages/message[@name='syntax']" />
<xsl:text>: &amp; {\ttfamily </xsl:text>
<xsl:apply-templates select="syntax" />
<xsl:text>}\\
</xsl:text>
<xsl:if test="default">
<xsl:value-of select="$messages/message[@name='default']" />
<xsl:text>: &amp; {\ttfamily </xsl:text>
<xsl:apply-templates select="default" />
<xsl:text>} \\
</xsl:text>
</xsl:if>
<xsl:value-of select="$messages/message[@name='context']" />
<xsl:text>: &amp;</xsl:text>
<xsl:apply-templates select="contextlist" />
<xsl:text> \\
</xsl:text>
<xsl:if test="override">
<xsl:value-of select="$messages/message[@name='override']"/>
<xsl:text>: &amp;</xsl:text>
<xsl:apply-templates select="override" />
<xsl:text> \\
</xsl:text>
</xsl:if>
<xsl:value-of select="$messages/message[@name='status']" />
<xsl:text>: &amp;</xsl:text>
<xsl:value-of select="/status" />
<xsl:text> \\
</xsl:text>
<xsl:value-of select="$messages/message[@name='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="$messages/message[@name='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="$messages/message[@name='serverconfig']" />
</xsl:when>
<xsl:when test="normalize-space(.) = 'virtual host'">
<xsl:value-of select="$messages/message[@name='virtualhost']" />
</xsl:when>
<xsl:when test="normalize-space(.) = 'directory'">
<xsl:value-of select="$messages/message[@name='directory']" />
</xsl:when>
<xsl:when test="normalize-space(.) = '.htaccess'">
<xsl:value-of select="$messages/message[@name='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>