latex.xsl revision b3137f48abe3090c5531392e57ff0fefd76f59eb
2N/A<?xml version="1.0" encoding="ISO-8859-1"?>
2N/A
2N/A<!--
2N/A Copyright 2003-2004 The Apache Software Foundation
2N/A
2N/A Licensed under the Apache License, Version 2.0 (the "License");
2N/A you may not use this file except in compliance with the License.
2N/A You may obtain a copy of the License at
2N/A
2N/A http://www.apache.org/licenses/LICENSE-2.0
2N/A
2N/A Unless required by applicable law or agreed to in writing, software
2N/A distributed under the License is distributed on an "AS IS" BASIS,
2N/A WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2N/A See the License for the specific language governing permissions and
2N/A limitations under the License.
2N/A-->
2N/A
2N/A<xsl:stylesheet version="1.0"
2N/A xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
58N/A
2N/A<xsl:output
2N/A method="text"
32N/A encoding="ISO-8859-1"
32N/A indent="no"
2N/A/>
2N/A
26N/A<!-- Read the localized messages from the specified language file -->
38N/A<xsl:variable name="message" select="document('/lang/en.xml')
38N/A /language/messages/message"/>
38N/A
29N/A<!-- Get the guts of the stylesheets -->
29N/A<xsl:include href="manualpage.xsl" />
29N/A<xsl:include href="common.xsl" />
29N/A<xsl:include href="html.xsl" />
26N/A<xsl:include href="synopsis.xsl" />
26N/A<xsl:include href="moduleindex.xsl" />
29N/A<xsl:include href="directiveindex.xsl" />
26N/A<xsl:include href="faq.xsl" />
2N/A<xsl:include href="quickreference.xsl" />
38N/A
2N/A<xsl:template match="sitemap">
6N/A<xsl:text>
2N/A\documentclass[10pt]{book}
58N/A\usepackage{times}
2N/A\usepackage{longtable}
2N/A\usepackage{style/latex/atbeginend}
34N/A\usepackage[pdftex]{graphicx}
34N/A\usepackage[colorlinks=true,letterpaper=true,linkcolor=blue,urlcolor=blue]{hyperref}
34N/A
34N/A% Let LaTeX be lenient about very-bad line wrapping.
49N/A\tolerance=9999
53N/A\emergencystretch=60pt
2N/A
34N/A% Adjust margins to a reasonable level
34N/A\topmargin 0pt
34N/A\advance \topmargin by -\headheight
59N/A\advance \topmargin by -\headsep
59N/A\textheight 8.9in
59N/A\oddsidemargin 0pt
59N/A\evensidemargin \oddsidemargin
2N/A\marginparwidth 0.5in
61N/A\textwidth 6.5in
61N/A
61N/A% Keep paragraphs flush left (rather than the default of indenting
61N/A% the first line) and put a space between paragraphs.
61N/A\setlength{\parindent}{0ex}
61N/A\addtolength{\parskip}{1.2ex}
61N/A
61N/A% Shrink the inter-item spaces
61N/A\AfterBegin{itemize}{\setlength{\itemsep}{0em}}
61N/A
61N/A\pagestyle{headings}
61N/A
61N/A\hypersetup{
61N/A pdftitle={</xsl:text>
61N/A<xsl:value-of select="$message[@id='apache']" />
61N/A<xsl:text> </xsl:text>
61N/A<xsl:value-of select="$message[@id='http-server']" />
61N/A<xsl:text> </xsl:text>
61N/A<xsl:value-of select="$message[@id='documentation']" />
61N/A<xsl:text> </xsl:text>
43N/A<xsl:value-of select="$message[@id='version']" />
43N/A<xsl:text>},
64N/A pdfauthor={Apache Software Foundation}
64N/A }
64N/A
43N/A\title{</xsl:text>
43N/A<xsl:value-of select="$message[@id='apache']" />
64N/A<xsl:text> </xsl:text>
64N/A<xsl:value-of select="$message[@id='http-server']" />
64N/A<xsl:text> </xsl:text>
64N/A<xsl:value-of select="$message[@id='documentation']" />
64N/A<xsl:text> </xsl:text>
64N/A<xsl:value-of select="$message[@id='version']" />
64N/A<xsl:text>\\ \bigskip \bigskip
64N/A\includegraphics{images/feather}\\ \bigskip}
64N/A\author{Apache Software Foundation}
64N/A\date{\today}
64N/A
64N/A\begin{document}
43N/A\frontmatter
16N/A\maketitle
16N/A
16N/A\section*{About The PDF Documentation}
34N/A
34N/ACopyright \copyright 2004 The Apache Software Foundation
16N/A
6N/ALicensed under the Apache License, Version 2.0 (the "License");
12N/Ayou may not use this file except in compliance with the License.
12N/AYou 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}
12N/A
12N/AThis version of the Apache HTTP Server Documentation is converted from
12N/AXML source files to \LaTeX\ using XSLT with the help of Apache Ant,
12N/AApache XML Xalan, and Apache XML Xerces.
12N/A
12N/ASince the HTML version of the documentation is more commonly checked
12N/Aduring development, the PDF version may contain some errors and
12N/Ainconsistencies, especially in formatting. If you have difficulty
12N/Areading a part of this file, please consult the HTML version
61N/Aof the documentation on the Apache HTTP Server website at
61N/A\href{http://httpd.apache.org/docs-2.0/}{http://httpd.apache.org/docs-2.0/}
61N/A
61N/AThe Apache HTTP Server Documentation is maintained by the Apache HTTP
61N/AServer Documentation Project. More information is available at
12N/A\href{http://httpd.apache.org/docs-project/}{http://httpd.apache.org/docs-project/}
12N/A
61N/A\tableofcontents
61N/A\mainmatter
12N/A</xsl:text>
2N/A
40N/A<xsl:for-each select="category">
40N/A <xsl:text>\chapter{</xsl:text>
40N/A <xsl:apply-templates select="title" mode="printcat"/>
40N/A <xsl:text>}
43N/A</xsl:text>
40N/A <xsl:apply-templates/>
2N/A</xsl:for-each>
2N/A
40N/A<xsl:text>\end{document}</xsl:text>
40N/A</xsl:template>
2N/A
40N/A<xsl:template match="page">
40N/A<xsl:text>\include{</xsl:text>
2N/A<xsl:choose>
2N/A<xsl:when test="contains(@href,'.')">
2N/A <xsl:value-of select="substring-before(@href,'.')"/>
2N/A</xsl:when>
2N/A<xsl:otherwise>
2N/A <xsl:value-of select="concat(@href,'index')"/>
2N/A</xsl:otherwise>
2N/A</xsl:choose>
2N/A<xsl:text>}
2N/A</xsl:text>
61N/A</xsl:template>
61N/A
61N/A<xsl:template match="category/title" mode="printcat">
61N/A<xsl:apply-templates/>
61N/A</xsl:template>
16N/A
16N/A<xsl:template match="category/title"></xsl:template>
2N/A
47N/A<xsl:template match="modulefilelist">
2N/A<xsl:apply-templates/>
2N/A</xsl:template>
2N/A
2N/A<xsl:template match="modulefile">
2N/A<xsl:text>\include{mod/</xsl:text>
2N/A<xsl:value-of select="substring-before(.,'.')"/>
2N/A<xsl:text>}
2N/A</xsl:text>
2N/A</xsl:template>
2N/A
2N/A<xsl:template match="summary">
2N/A<xsl:apply-templates/>
2N/A</xsl:template>
7N/A
43N/A<xsl:template name="replace-string">
43N/A <xsl:param name="text"/>
16N/A <xsl:param name="replace"/>
43N/A <xsl:param name="with"/>
61N/A
61N/A <xsl:choose>
61N/A <xsl:when test="not(contains($text,$replace))">
61N/A <xsl:value-of select="$text"/>
61N/A </xsl:when>
61N/A <xsl:otherwise>
61N/A <xsl:value-of select="substring-before($text,$replace)"/>
61N/A <xsl:value-of select="$with"/>
61N/A <xsl:call-template name="replace-string">
61N/A <xsl:with-param name="text" select="substring-after($text,$replace)"/>
61N/A <xsl:with-param name="replace" select="$replace"/>
61N/A <xsl:with-param name="with" select="$with"/>
61N/A </xsl:call-template>
61N/A </xsl:otherwise>
61N/A </xsl:choose>
61N/A</xsl:template>
61N/A
61N/A<!-- ==================================================================== -->
61N/A<!-- Take care of all the LaTeX special characters. -->
61N/A<!-- Silly multi-variable technique used to avoid deep recursion. -->
61N/A<!-- ==================================================================== -->
61N/A<xsl:template match="text()">
61N/A<xsl:call-template name="ltescape">
61N/A <xsl:with-param name="string" select="."/>
61N/A</xsl:call-template>
61N/A</xsl:template>
61N/A
61N/A
61N/A<xsl:template name="ltescape">
61N/A<xsl:param name="string"/>
61N/A
61N/A<xsl:variable name="result1">
61N/A <xsl:choose>
61N/A <xsl:when test="contains($string, '\')">
61N/A <xsl:call-template name="replace-string">
61N/A <xsl:with-param name="replace" select="'\'"/>
61N/A <xsl:with-param name="with" select="'\textbackslash '"/>
61N/A <xsl:with-param name="text" select="normalize-space($string)"/>
61N/A </xsl:call-template>
61N/A </xsl:when>
61N/A <xsl:otherwise>
61N/A <xsl:value-of select="$string"/>
61N/A </xsl:otherwise>
61N/A </xsl:choose>
61N/A</xsl:variable>
61N/A
61N/A<xsl:variable name="result2">
61N/A <xsl:choose>
61N/A <xsl:when test="contains($result1, '$')">
61N/A <xsl:call-template name="replace-string">
61N/A <xsl:with-param name="replace" select="'$'"/>
61N/A <xsl:with-param name="with" select="'\$'"/>
61N/A <xsl:with-param name="text" select="$result1"/>
61N/A </xsl:call-template>
61N/A </xsl:when>
61N/A <xsl:otherwise>
61N/A <xsl:value-of select="$result1"/>
61N/A </xsl:otherwise>
61N/A </xsl:choose>
61N/A</xsl:variable>
61N/A
61N/A<xsl:variable name="result3">
61N/A <xsl:choose>
61N/A <xsl:when test="contains($result2, '{')">
61N/A <xsl:call-template name="replace-string">
61N/A <xsl:with-param name="replace" select="'{'"/>
61N/A <xsl:with-param name="with" select="'\{'"/>
61N/A <xsl:with-param name="text" select="$result2"/>
61N/A </xsl:call-template>
61N/A </xsl:when>
61N/A <xsl:otherwise>
61N/A <xsl:value-of select="$result2"/>
64N/A </xsl:otherwise>
64N/A </xsl:choose>
64N/A</xsl:variable>
64N/A
64N/A<xsl:variable name="result4">
62N/A <xsl:choose>
64N/A <xsl:when test="contains($result3, '}')">
64N/A <xsl:call-template name="replace-string">
64N/A <xsl:with-param name="replace" select="'}'"/>
64N/A <xsl:with-param name="with" select="'\}'"/>
64N/A <xsl:with-param name="text" select="$result3"/>
64N/A </xsl:call-template>
64N/A </xsl:when>
62N/A <xsl:otherwise>
62N/A <xsl:value-of select="$result3"/>
62N/A </xsl:otherwise>
62N/A </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>