latex.xsl revision 4b877ced785d2adda5268201595022ca626fa7fe
10N/A<?xml version="1.0" encoding="ISO-8859-1"?>
10N/A<!DOCTYPE xsl:stylesheet [
10N/A <!ENTITY lf SYSTEM "/xsl/util/lf.xml">
10N/A <!ENTITY % HTTPD-VERSION SYSTEM "/version.ent">
10N/A %HTTPD-VERSION;
10N/A]>
10N/A
10N/A<!--
10N/A Licensed to the Apache Software Foundation (ASF) under one or more
10N/A contributor license agreements. See the NOTICE file distributed with
10N/A this work for additional information regarding copyright ownership.
10N/A The ASF licenses this file to You under the Apache License, Version 2.0
10N/A (the "License"); you may not use this file except in compliance with
10N/A the License. You may obtain a copy of the License at
10N/A
10N/A http://www.apache.org/licenses/LICENSE-2.0
10N/A
10N/A Unless required by applicable law or agreed to in writing, software
10N/A distributed under the License is distributed on an "AS IS" BASIS,
10N/A WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10N/A See the License for the specific language governing permissions and
10N/A limitations under the License.
10N/A-->
10N/A
10N/A<xsl:stylesheet version="1.0"
10N/A xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
10N/A
10N/A<xsl:output
10N/A method="text"
10N/A encoding="ISO-8859-1"
10N/A indent="no"
10N/A/>
10N/A
10N/A<!-- Read the localized messages from the specified language file -->
10N/A<xsl:variable name="message" select="document('/lang/en.xml')
10N/A /language/messages/message"/>
10N/A<xsl:variable name="allmodules" select="document('/xsl/util/allmodules.xml')
10N/A /items/item[@lang='en']"/>
10N/A
10N/A<!-- Get the guts of the stylesheets -->
10N/A<xsl:include href="manualpage.xsl" />
10N/A<xsl:include href="common.xsl" />
10N/A<xsl:include href="html.xsl" />
10N/A<xsl:include href="synopsis.xsl" />
10N/A<xsl:include href="moduleindex.xsl" />
10N/A<xsl:include href="directiveindex.xsl" />
10N/A<xsl:include href="faq.xsl" />
10N/A<xsl:include href="quickreference.xsl" />
10N/A
10N/A<xsl:template match="sitemap">
10N/A<xsl:text>
10N/A\documentclass[10pt]{book}
10N/A\usepackage{times}
10N/A\usepackage{longtable}
10N/A\usepackage{style/latex/atbeginend}
10N/A\usepackage[pdftex]{graphicx}
10N/A\usepackage[colorlinks=true,letterpaper=true,linkcolor=blue,urlcolor=blue]{hyperref}
10N/A
10N/A% Let LaTeX be lenient about very-bad line wrapping.
10N/A\tolerance=9999
10N/A\emergencystretch=60pt
10N/A
10N/A% Adjust margins to a reasonable level
10N/A\topmargin 0pt
10N/A\advance \topmargin by -\headheight
10N/A\advance \topmargin by -\headsep
10N/A\textheight 8.9in
10N/A\oddsidemargin 0pt
10N/A\evensidemargin \oddsidemargin
10N/A\marginparwidth 0.5in
10N/A\textwidth 6.5in
10N/A
10N/A% Keep paragraphs flush left (rather than the default of indenting
10N/A% the first line) and put a space between paragraphs.
10N/A\setlength{\parindent}{0ex}
10N/A\addtolength{\parskip}{1.2ex}
10N/A
10N/A% Make space in TOC between section numbers and section title (large numbers!)
10N/A\makeatletter
10N/A\renewcommand*\l@section{\@dottedtocline{1}{1.5em}{3.6em}}
10N/A\makeatother
10N/A
10N/A% Shrink the inter-item spaces
10N/A\AfterBegin{itemize}{\setlength{\itemsep}{0em}}
10N/A
10N/A\pagestyle{headings}
10N/A
10N/A\hypersetup{
10N/A pdftitle={</xsl:text>
10N/A<xsl:value-of select="$message[@id='apache']" />
10N/A<xsl:text> </xsl:text>
10N/A<xsl:value-of select="$message[@id='http-server']" />
10N/A<xsl:text> </xsl:text>
10N/A<xsl:value-of select="$message[@id='documentation']" />
10N/A<xsl:text> </xsl:text>
10N/A<xsl:value-of select="$message[@id='version']" />
10N/A<xsl:text>},
10N/A pdfauthor={Apache Software Foundation}
10N/A }
10N/A
10N/A\title{</xsl:text>
10N/A<xsl:value-of select="$message[@id='apache']" />
10N/A<xsl:text> </xsl:text>
10N/A<xsl:value-of select="$message[@id='http-server']" />
10N/A<xsl:text> </xsl:text>
10N/A<xsl:value-of select="$message[@id='documentation']" />
10N/A<xsl:text> </xsl:text>
10N/A<xsl:value-of select="$message[@id='version']" />
10N/A<xsl:text>\\ \bigskip \bigskip
10N/A\includegraphics{images/feather}\\ \bigskip}
10N/A\author{Apache Software Foundation}
10N/A\date{\today}
10N/A
10N/A\begin{document}
10N/A\frontmatter
10N/A\maketitle
10N/A
10N/A\section*{About The PDF Documentation}
10N/A
10N/ALicensed to the Apache Software Foundation (ASF) under one or more
10N/Acontributor license agreements. See the NOTICE file distributed with
10N/Athis work for additional information regarding copyright ownership.
10N/AThe ASF licenses this file to You under the Apache License, Version 2.0
10N/A(the "License"); you may not use this file except in compliance with
10N/Athe License. You 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}
10N/A
10N/AThis version of the Apache HTTP Server Documentation is converted from
10N/AXML source files to \LaTeX\ using XSLT with the help of Apache Ant,
10N/AApache XML Xalan, and Apache XML Xerces.
10N/A
10N/ASince the HTML version of the documentation is more commonly checked
10N/Aduring development, the PDF version may contain some errors and
10N/Ainconsistencies, especially in formatting. If you have difficulty
10N/Areading a part of this file, please consult the HTML version
10N/Aof the documentation on the Apache HTTP Server website at
10N/A\href{http://httpd.apache.org/docs/&httpd.docs;/}{http://httpd.apache.org/docs/&httpd.docs;/}
10N/A
10N/AThe Apache HTTP Server Documentation is maintained by the Apache HTTP
10N/AServer Documentation Project. More information is available at
10N/A\href{http://httpd.apache.org/docs-project/}{http://httpd.apache.org/docs-project/}
10N/A
10N/A\tableofcontents
10N/A\mainmatter
10N/A</xsl:text>
10N/A
10N/A<xsl:for-each select="category">
10N/A <xsl:text>\chapter{</xsl:text>
10N/A <xsl:apply-templates select="title" mode="printcat"/>
10N/A <xsl:text>}
10N/A</xsl:text>
10N/A <xsl:apply-templates />
<xsl:if test="@id = 'modules'">
<xsl:text>\include{mod/module-dict}</xsl:text>&lf;
<xsl:text>\include{mod/directive-dict}</xsl:text>&lf;
<xsl:apply-templates select="document($allmodules)/modulefilelist" />
</xsl:if>
<xsl:if test="@id = 'index'">
<xsl:text>\include{mod/index}</xsl:text>&lf;
<xsl:text>\include{mod/quickreference}</xsl:text>&lf;
</xsl:if>
</xsl:for-each>
<xsl:text>\end{document}</xsl:text>
</xsl:template>
<xsl:template match="page">
<xsl:if test="not(starts-with(@href,'http:') or starts-with(@href, 'https:') or starts-with(@href, 'mod/'))">
<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>&lf;
</xsl:if>
</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>&lf;
</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()|@*" mode="tabular">
<xsl:call-template name="ltescape">
<xsl:with-param name="string" select="."/>
</xsl:call-template>
</xsl:template>
<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="'&#8212;'" />
<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="'%'"/>
<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:with-param>
</xsl:call-template>
</xsl:template>
</xsl:stylesheet>