latex.xsl revision 0097a4f3e468c0192a2ce52ffee7bc8cea0a620b
558998ce664055a75595371118f818084d8f2b23Jan Cholasta<?xml version="1.0" encoding="ISO-8859-1"?>
558998ce664055a75595371118f818084d8f2b23Jan Cholasta
558998ce664055a75595371118f818084d8f2b23Jan Cholasta<!--
558998ce664055a75595371118f818084d8f2b23Jan Cholasta Copyright 2003-2004 The Apache Software Foundation
558998ce664055a75595371118f818084d8f2b23Jan Cholasta
558998ce664055a75595371118f818084d8f2b23Jan Cholasta Licensed under the Apache License, Version 2.0 (the "License");
558998ce664055a75595371118f818084d8f2b23Jan Cholasta you may not use this file except in compliance with the License.
558998ce664055a75595371118f818084d8f2b23Jan Cholasta You may obtain a copy of the License at
558998ce664055a75595371118f818084d8f2b23Jan Cholasta
558998ce664055a75595371118f818084d8f2b23Jan Cholasta http://www.apache.org/licenses/LICENSE-2.0
558998ce664055a75595371118f818084d8f2b23Jan Cholasta
558998ce664055a75595371118f818084d8f2b23Jan Cholasta Unless required by applicable law or agreed to in writing, software
558998ce664055a75595371118f818084d8f2b23Jan Cholasta distributed under the License is distributed on an "AS IS" BASIS,
558998ce664055a75595371118f818084d8f2b23Jan Cholasta WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
558998ce664055a75595371118f818084d8f2b23Jan Cholasta See the License for the specific language governing permissions and
558998ce664055a75595371118f818084d8f2b23Jan Cholasta limitations under the License.
558998ce664055a75595371118f818084d8f2b23Jan Cholasta-->
558998ce664055a75595371118f818084d8f2b23Jan Cholasta
558998ce664055a75595371118f818084d8f2b23Jan Cholasta<xsl:stylesheet version="1.0"
558998ce664055a75595371118f818084d8f2b23Jan Cholasta xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
558998ce664055a75595371118f818084d8f2b23Jan Cholasta
558998ce664055a75595371118f818084d8f2b23Jan Cholasta<xsl:output
558998ce664055a75595371118f818084d8f2b23Jan Cholasta method="text"
558998ce664055a75595371118f818084d8f2b23Jan Cholasta encoding="ISO-8859-1"
558998ce664055a75595371118f818084d8f2b23Jan Cholasta indent="no"
558998ce664055a75595371118f818084d8f2b23Jan Cholasta/>
558998ce664055a75595371118f818084d8f2b23Jan Cholasta
558998ce664055a75595371118f818084d8f2b23Jan Cholasta<!-- Read the localized messages from the specified language file -->
558998ce664055a75595371118f818084d8f2b23Jan Cholasta<xsl:variable name="messages" select="document('/lang/en.xml')/messages"/>
558998ce664055a75595371118f818084d8f2b23Jan Cholasta
558998ce664055a75595371118f818084d8f2b23Jan Cholasta<!-- Get the guts of the stylesheets -->
558998ce664055a75595371118f818084d8f2b23Jan Cholasta<xsl:include href="manualpage.xsl" />
558998ce664055a75595371118f818084d8f2b23Jan Cholasta<xsl:include href="common.xsl" />
558998ce664055a75595371118f818084d8f2b23Jan Cholasta<xsl:include href="html.xsl" />
558998ce664055a75595371118f818084d8f2b23Jan Cholasta<xsl:include href="synopsis.xsl" />
558998ce664055a75595371118f818084d8f2b23Jan Cholasta<xsl:include href="moduleindex.xsl" />
558998ce664055a75595371118f818084d8f2b23Jan Cholasta<xsl:include href="directiveindex.xsl" />
558998ce664055a75595371118f818084d8f2b23Jan Cholasta<xsl:include href="faq.xsl" />
558998ce664055a75595371118f818084d8f2b23Jan Cholasta<xsl:include href="quickreference.xsl" />
558998ce664055a75595371118f818084d8f2b23Jan Cholasta
558998ce664055a75595371118f818084d8f2b23Jan Cholasta<xsl:template match="sitemap">
558998ce664055a75595371118f818084d8f2b23Jan Cholasta<xsl:text>
558998ce664055a75595371118f818084d8f2b23Jan Cholasta\documentclass[10pt]{book}
558998ce664055a75595371118f818084d8f2b23Jan Cholasta\usepackage{times}
558998ce664055a75595371118f818084d8f2b23Jan Cholasta\usepackage{longtable}
558998ce664055a75595371118f818084d8f2b23Jan Cholasta\usepackage{style/latex/atbeginend}
558998ce664055a75595371118f818084d8f2b23Jan Cholasta\usepackage[pdftex]{graphicx}
558998ce664055a75595371118f818084d8f2b23Jan Cholasta\usepackage[colorlinks=true,letterpaper=true,linkcolor=blue,urlcolor=blue]{hyperref}
558998ce664055a75595371118f818084d8f2b23Jan Cholasta
558998ce664055a75595371118f818084d8f2b23Jan Cholasta% Let LaTeX be lenient about very-bad line wrapping.
558998ce664055a75595371118f818084d8f2b23Jan Cholasta\tolerance=9999
558998ce664055a75595371118f818084d8f2b23Jan Cholasta\emergencystretch=60pt
558998ce664055a75595371118f818084d8f2b23Jan Cholasta
558998ce664055a75595371118f818084d8f2b23Jan Cholasta% Adjust margins to a reasonable level
558998ce664055a75595371118f818084d8f2b23Jan Cholasta\topmargin 0pt
558998ce664055a75595371118f818084d8f2b23Jan Cholasta\advance \topmargin by -\headheight
558998ce664055a75595371118f818084d8f2b23Jan Cholasta\advance \topmargin by -\headsep
558998ce664055a75595371118f818084d8f2b23Jan Cholasta\textheight 8.9in
558998ce664055a75595371118f818084d8f2b23Jan Cholasta\oddsidemargin 0pt
558998ce664055a75595371118f818084d8f2b23Jan Cholasta\evensidemargin \oddsidemargin
558998ce664055a75595371118f818084d8f2b23Jan Cholasta\marginparwidth 0.5in
558998ce664055a75595371118f818084d8f2b23Jan Cholasta\textwidth 6.5in
558998ce664055a75595371118f818084d8f2b23Jan Cholasta
558998ce664055a75595371118f818084d8f2b23Jan Cholasta% Keep paragraphs flush left (rather than the default of indenting
558998ce664055a75595371118f818084d8f2b23Jan Cholasta% the first line) and put a space between paragraphs.
558998ce664055a75595371118f818084d8f2b23Jan Cholasta\setlength{\parindent}{0ex}
558998ce664055a75595371118f818084d8f2b23Jan Cholasta\addtolength{\parskip}{1.2ex}
558998ce664055a75595371118f818084d8f2b23Jan Cholasta
558998ce664055a75595371118f818084d8f2b23Jan Cholasta% Shrink the inter-item spaces
558998ce664055a75595371118f818084d8f2b23Jan Cholasta\AfterBegin{itemize}{\setlength{\itemsep}{0em}}
558998ce664055a75595371118f818084d8f2b23Jan Cholasta
558998ce664055a75595371118f818084d8f2b23Jan Cholasta\pagestyle{headings}
558998ce664055a75595371118f818084d8f2b23Jan Cholasta
558998ce664055a75595371118f818084d8f2b23Jan Cholasta\hypersetup{
558998ce664055a75595371118f818084d8f2b23Jan Cholasta pdftitle={</xsl:text>
558998ce664055a75595371118f818084d8f2b23Jan Cholasta<xsl:value-of select="$messages/message[@name='apache']" />
558998ce664055a75595371118f818084d8f2b23Jan Cholasta<xsl:text> </xsl:text>
558998ce664055a75595371118f818084d8f2b23Jan Cholasta<xsl:value-of select="$messages/message[@name='http-server']" />
558998ce664055a75595371118f818084d8f2b23Jan Cholasta<xsl:text> </xsl:text>
558998ce664055a75595371118f818084d8f2b23Jan Cholasta<xsl:value-of select="$messages/message[@name='documentation']" />
558998ce664055a75595371118f818084d8f2b23Jan Cholasta<xsl:text> </xsl:text>
558998ce664055a75595371118f818084d8f2b23Jan Cholasta<xsl:value-of select="$messages/message[@name='version']" />
558998ce664055a75595371118f818084d8f2b23Jan Cholasta<xsl:text>},
558998ce664055a75595371118f818084d8f2b23Jan Cholasta pdfauthor={Apache Software Foundation}
558998ce664055a75595371118f818084d8f2b23Jan Cholasta }
558998ce664055a75595371118f818084d8f2b23Jan Cholasta
558998ce664055a75595371118f818084d8f2b23Jan Cholasta\title{</xsl:text>
558998ce664055a75595371118f818084d8f2b23Jan Cholasta<xsl:value-of select="$messages/message[@name='apache']" />
558998ce664055a75595371118f818084d8f2b23Jan Cholasta<xsl:text> </xsl:text>
558998ce664055a75595371118f818084d8f2b23Jan Cholasta<xsl:value-of select="$messages/message[@name='http-server']" />
558998ce664055a75595371118f818084d8f2b23Jan Cholasta<xsl:text> </xsl:text>
558998ce664055a75595371118f818084d8f2b23Jan Cholasta<xsl:value-of select="$messages/message[@name='documentation']" />
558998ce664055a75595371118f818084d8f2b23Jan Cholasta<xsl:text> </xsl:text>
558998ce664055a75595371118f818084d8f2b23Jan Cholasta<xsl:value-of select="$messages/message[@name='version']" />
558998ce664055a75595371118f818084d8f2b23Jan Cholasta<xsl:text>\\ \bigskip \bigskip
558998ce664055a75595371118f818084d8f2b23Jan Cholasta\includegraphics{images/feather}\\ \bigskip}
558998ce664055a75595371118f818084d8f2b23Jan Cholasta\author{Apache Software Foundation}
558998ce664055a75595371118f818084d8f2b23Jan Cholasta\date{\today}
558998ce664055a75595371118f818084d8f2b23Jan Cholasta
558998ce664055a75595371118f818084d8f2b23Jan Cholasta\begin{document}
558998ce664055a75595371118f818084d8f2b23Jan Cholasta\frontmatter
558998ce664055a75595371118f818084d8f2b23Jan Cholasta\maketitle
558998ce664055a75595371118f818084d8f2b23Jan Cholasta
558998ce664055a75595371118f818084d8f2b23Jan Cholasta\section*{About The PDF Documentation}
558998ce664055a75595371118f818084d8f2b23Jan Cholasta
558998ce664055a75595371118f818084d8f2b23Jan CholastaCopyright \copyright 2004 The Apache Software Foundation
558998ce664055a75595371118f818084d8f2b23Jan Cholasta
558998ce664055a75595371118f818084d8f2b23Jan CholastaLicensed under the Apache License, Version 2.0 (the "License");
558998ce664055a75595371118f818084d8f2b23Jan Cholastayou may not use this file except in compliance with the License.
558998ce664055a75595371118f818084d8f2b23Jan CholastaYou may obtain a copy of the License at \href{http://www.apache.org/licenses/LICENSE-2.0}{http://www.apache.org/licenses/LICENSE-2.0}
This version of the Apache HTTP Server Documentation is converted from
XML source files to \LaTeX\ using XSLT with the help of Apache Ant,
Apache XML Xalan, and Apache XML Xerces.
Since the HTML version of the documentation is more commonly checked
during development, the PDF version may contain some errors and
inconsistencies, especially in formatting. If you have difficulty
reading a part of this file, please consult the HTML version
of the documentation on the Apache HTTP Server website at
\href{http://httpd.apache.org/docs-2.0/}{http://httpd.apache.org/docs-2.0/}
The Apache HTTP Server Documentation is maintained by the Apache HTTP
Server Documentation Project. More information is available at
\href{http://httpd.apache.org/docs-project/}{http://httpd.apache.org/docs-project/}
\tableofcontents
\mainmatter
</xsl:text>
<xsl:for-each select="category">
<xsl:text>\chapter{</xsl:text>
<xsl:apply-templates select="title" mode="printcat"/>
<xsl:text>}
</xsl:text>
<xsl:apply-templates/>
</xsl:for-each>
<xsl:text>\end{document}</xsl:text>
</xsl:template>
<xsl:template match="page">
<xsl:text>\include{</xsl:text>
<xsl:choose>
<xsl:when test="contains(@href,'.')">
<xsl:value-of select="substring-before(@href,'.')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat(@href,'index')"/>
</xsl:otherwise>
</xsl:choose>
<xsl:text>}
</xsl:text>
</xsl:template>
<xsl:template match="category/title" mode="printcat">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="category/title"></xsl:template>
<xsl:template match="modulefilelist">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="modulefile">
<xsl:text>\include{mod/</xsl:text>
<xsl:value-of select="substring-before(.,'.')"/>
<xsl:text>}
</xsl:text>
</xsl:template>
<xsl:template match="summary">
<xsl:apply-templates/>
</xsl:template>
<xsl:template name="replace-string">
<xsl:param name="text"/>
<xsl:param name="replace"/>
<xsl:param name="with"/>
<xsl:choose>
<xsl:when test="not(contains($text,$replace))">
<xsl:value-of select="$text"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="substring-before($text,$replace)"/>
<xsl:value-of select="$with"/>
<xsl:call-template name="replace-string">
<xsl:with-param name="text" select="substring-after($text,$replace)"/>
<xsl:with-param name="replace" select="$replace"/>
<xsl:with-param name="with" select="$with"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- ==================================================================== -->
<!-- Take care of all the LaTeX special characters. -->
<!-- Silly multi-variable technique used to avoid deep recursion. -->
<!-- ==================================================================== -->
<xsl:template match="text()">
<xsl:call-template name="ltescape">
<xsl:with-param name="string" select="."/>
</xsl:call-template>
</xsl:template>
<xsl:template name="ltescape">
<xsl:param name="string"/>
<xsl:variable name="result1">
<xsl:choose>
<xsl:when test="contains($string, '\')">
<xsl:call-template name="replace-string">
<xsl:with-param name="replace" select="'\'"/>
<xsl:with-param name="with" select="'\textbackslash '"/>
<xsl:with-param name="text" select="normalize-space($string)"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$string"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="result2">
<xsl:choose>
<xsl:when test="contains($result1, '$')">
<xsl:call-template name="replace-string">
<xsl:with-param name="replace" select="'$'"/>
<xsl:with-param name="with" select="'\$'"/>
<xsl:with-param name="text" select="$result1"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$result1"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="result3">
<xsl:choose>
<xsl:when test="contains($result2, '{')">
<xsl:call-template name="replace-string">
<xsl:with-param name="replace" select="'{'"/>
<xsl:with-param name="with" select="'\{'"/>
<xsl:with-param name="text" select="$result2"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$result2"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="result4">
<xsl:choose>
<xsl:when test="contains($result3, '}')">
<xsl:call-template name="replace-string">
<xsl:with-param name="replace" select="'}'"/>
<xsl:with-param name="with" select="'\}'"/>
<xsl:with-param name="text" select="$result3"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$result3"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- The '[' and ']' characters don't, in general, need to be
escaped. But there are times when it is ambiguous whether
[ is the beginning of an optional argument or a literal '['.
Hence, it is safer to protect the literal ones with {}. -->
<xsl:variable name="result5">
<xsl:choose>
<xsl:when test="contains($result4, '[')">
<xsl:call-template name="replace-string">
<xsl:with-param name="replace" select="'['"/>
<xsl:with-param name="with" select="'{[}'"/>
<xsl:with-param name="text" select="$result4"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$result4"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="result6">
<xsl:choose>
<xsl:when test="contains($result5, ']')">
<xsl:call-template name="replace-string">
<xsl:with-param name="replace" select="']'"/>
<xsl:with-param name="with" select="'{]}'"/>
<xsl:with-param name="text" select="$result5"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$result5"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="result7">
<xsl:choose>
<xsl:when test="contains($result6, '&quot;')">
<xsl:call-template name="replace-string">
<xsl:with-param name="replace" select="'&quot;'"/>
<xsl:with-param name="with" select="'\texttt{&quot;}'"/>
<xsl:with-param name="text" select="$result6"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$result6"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:call-template name="replace-string">
<xsl:with-param name="replace" select="'_'"/>
<xsl:with-param name="with" select="'\_'"/>
<xsl:with-param name="text">
<xsl:call-template name="replace-string">
<xsl:with-param name="replace" select="'#'"/>
<xsl:with-param name="with" select="'\#'"/>
<xsl:with-param name="text">
<xsl:call-template name="replace-string">
<xsl:with-param name="replace" select="'%'"/>
<xsl:with-param name="with" select="'\%'"/>
<xsl:with-param name="text">
<xsl:call-template name="replace-string">
<xsl:with-param name="replace" select="'&gt;'"/>
<xsl:with-param name="with" select="'\textgreater{}'"/>
<xsl:with-param name="text">
<xsl:call-template name="replace-string">
<xsl:with-param name="replace" select="'&lt;'"/>
<xsl:with-param name="with" select="'\textless{}'"/>
<xsl:with-param name="text">
<xsl:call-template name="replace-string">
<xsl:with-param name="replace" select="'~'"/>
<xsl:with-param name="with" select="'\textasciitilde{}'"/>
<xsl:with-param name="text">
<xsl:call-template name="replace-string">
<xsl:with-param name="replace" select="'^'"/>
<xsl:with-param name="with" select="'\^{}'"/>
<xsl:with-param name="text">
<xsl:call-template name="replace-string">
<xsl:with-param name="replace" select="'&amp;'"/>
<xsl:with-param name="with" select="'\&amp;'"/>
<xsl:with-param name="text" select="$result7"/>
</xsl:call-template>
</xsl:with-param>
</xsl:call-template>
</xsl:with-param>
</xsl:call-template>
</xsl:with-param>
</xsl:call-template>
</xsl:with-param>
</xsl:call-template>
</xsl:with-param>
</xsl:call-template>
</xsl:with-param>
</xsl:call-template>
</xsl:with-param>
</xsl:call-template>
</xsl:template>
</xsl:stylesheet>