latex.xsl revision 368bcafaedaee463f769c1b5f3547b9970df90d0
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<?xml version="1.0" encoding="ISO-8859-1"?>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:stylesheet version="1.0"
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:output
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive method="text"
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive encoding="ISO-8859-1"
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive indent="no"
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive/>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<!-- Read the localized messages from the specified language file -->
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:variable name="messages" select="document('/lang/en.xml')/messages"/>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<!-- Get the guts of the stylesheets -->
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:include href="manualpage.xsl" />
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:include href="common.xsl" />
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:include href="html.xsl" />
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:include href="synopsis.xsl" />
87ea898bcffe2ef490e833dc246a1cc0465d783fslive<xsl:include href="moduleindex.xsl" />
5e9423b4ca454c6416a2dc465dea1b1d34cec7a9slive<xsl:include href="directiveindex.xsl" />
1cb160a981947e75a8353da3fe40a653aa87100eslive<xsl:include href="faq.xsl" />
1cb160a981947e75a8353da3fe40a653aa87100eslive<xsl:include href="quickreference.xsl" />
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:template match="sitemap">
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:text>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive\documentclass[11pt]{book}
46d1ef8cb385aa2f519ce7d355afc51f144bd938slive\usepackage{times}
1cb160a981947e75a8353da3fe40a653aa87100eslive\usepackage{longtable}
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive\usepackage{style/latex/atbeginend}
1c6a10274e908898347be82bc82bc7ae18c66410slive%\usepackage[pdftex]{color}
1cb160a981947e75a8353da3fe40a653aa87100eslive\usepackage[colorlinks=true,letterpaper=true,linkcolor=green,urlcolor=blue]{hyperref}
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive% Let LaTeX be lenient about very-bad line wrapping.
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive\tolerance=9999
5e9423b4ca454c6416a2dc465dea1b1d34cec7a9slive\emergencystretch=60pt
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive
1c6a10274e908898347be82bc82bc7ae18c66410slive% Adjust margins to a reasonable level
1c6a10274e908898347be82bc82bc7ae18c66410slive\topmargin 0pt
1c6a10274e908898347be82bc82bc7ae18c66410slive\advance \topmargin by -\headheight
1c6a10274e908898347be82bc82bc7ae18c66410slive\advance \topmargin by -\headsep
1c6a10274e908898347be82bc82bc7ae18c66410slive\textheight 8.9in
1c6a10274e908898347be82bc82bc7ae18c66410slive\oddsidemargin 0pt
1c6a10274e908898347be82bc82bc7ae18c66410slive\evensidemargin \oddsidemargin
1c6a10274e908898347be82bc82bc7ae18c66410slive\marginparwidth 0.5in
1c6a10274e908898347be82bc82bc7ae18c66410slive\textwidth 6.5in
1c6a10274e908898347be82bc82bc7ae18c66410slive
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive% Keep paragraphs flush left (rather than the default of indenting
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive% the first line) and put a space between paragraphs.
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive\setlength{\parindent}{0ex}
46d1ef8cb385aa2f519ce7d355afc51f144bd938slive\addtolength{\parskip}{1.2ex}
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive% Shrink the inter-item spaces
01979b991e320f79fe2c1ae2afc298e8651bd69aslive\AfterBegin{itemize}{\addtolength{\itemsep}{-.6\baselineskip}}
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive\pagestyle{headings}
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive
1c6a10274e908898347be82bc82bc7ae18c66410slive\hypersetup{
1c6a10274e908898347be82bc82bc7ae18c66410slive pdftitle={</xsl:text>
1c6a10274e908898347be82bc82bc7ae18c66410slive<xsl:value-of select="$messages/message[@name='apache']" />
1c6a10274e908898347be82bc82bc7ae18c66410slive<xsl:text> </xsl:text>
1c6a10274e908898347be82bc82bc7ae18c66410slive<xsl:value-of select="$messages/message[@name='http-server']" />
1c6a10274e908898347be82bc82bc7ae18c66410slive<xsl:text> </xsl:text>
1c6a10274e908898347be82bc82bc7ae18c66410slive<xsl:value-of select="$messages/message[@name='documentation']" />
1c6a10274e908898347be82bc82bc7ae18c66410slive<xsl:text> </xsl:text>
1c6a10274e908898347be82bc82bc7ae18c66410slive<xsl:value-of select="$messages/message[@name='version']" />
1c6a10274e908898347be82bc82bc7ae18c66410slive<xsl:text>},
1c6a10274e908898347be82bc82bc7ae18c66410slive pdfauthor={Apache Software Foundation}
1c6a10274e908898347be82bc82bc7ae18c66410slive }
1c6a10274e908898347be82bc82bc7ae18c66410slive
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive\title{</xsl:text>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:value-of select="$messages/message[@name='apache']" />
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:text> </xsl:text>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:value-of select="$messages/message[@name='http-server']" />
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:text> </xsl:text>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:value-of select="$messages/message[@name='documentation']" />
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:text> </xsl:text>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:value-of select="$messages/message[@name='version']" />
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:text>}
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive\author{Apache Software Foundation}
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive\date{\today}
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive\begin{document}
5e9423b4ca454c6416a2dc465dea1b1d34cec7a9slive\frontmatter
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive\maketitle
368bcafaedaee463f769c1b5f3547b9970df90d0slive
368bcafaedaee463f769c1b5f3547b9970df90d0slive\section*{About The PDF Documentation}
368bcafaedaee463f769c1b5f3547b9970df90d0slive
368bcafaedaee463f769c1b5f3547b9970df90d0sliveThis is an early release of the PDF version of the Apache
368bcafaedaee463f769c1b5f3547b9970df90d0sliveDocumentation. It is converted from XML source files, and may contain
368bcafaedaee463f769c1b5f3547b9970df90d0slivesome errors and inconsistencies. If you have difficulty reading a
368bcafaedaee463f769c1b5f3547b9970df90d0slivepart of this file, please consult instead the HTML version of the
368bcafaedaee463f769c1b5f3547b9970df90d0slivedocumentation on the Apache HTTP Server website.
368bcafaedaee463f769c1b5f3547b9970df90d0slive
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive\tableofcontents
5e9423b4ca454c6416a2dc465dea1b1d34cec7a9slive\mainmatter
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive</xsl:text>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:for-each select="category">
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:text>\chapter{</xsl:text>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:apply-templates select="title" mode="printcat"/>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:text>}
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive</xsl:text>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:apply-templates/>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive</xsl:for-each>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:text>\end{document}</xsl:text>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive</xsl:template>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:template match="page">
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:text>\include{</xsl:text>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:choose>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:when test="contains(@href,'.')">
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:value-of select="substring-before(@href,'.')"/>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive</xsl:when>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:otherwise>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:value-of select="concat(@href,'index')"/>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive</xsl:otherwise>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive</xsl:choose>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:text>}
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive</xsl:text>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive</xsl:template>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:template match="category/title" mode="printcat">
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:apply-templates/>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive</xsl:template>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:template match="category/title"></xsl:template>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:template match="modulefilelist">
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:apply-templates/>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive</xsl:template>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:template match="modulefile">
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:text>\include{mod/</xsl:text>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:value-of select="substring-before(.,'.')"/>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:text>}
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive</xsl:text>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive</xsl:template>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:template match="summary">
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:apply-templates/>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive</xsl:template>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:template name="replace-string">
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:param name="text"/>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:param name="replace"/>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:param name="with"/>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:choose>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:when test="not(contains($text,$replace))">
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:value-of select="$text"/>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive </xsl:when>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:otherwise>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:value-of select="substring-before($text,$replace)"/>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:value-of select="$with"/>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:call-template name="replace-string">
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:with-param name="text" select="substring-after($text,$replace)"/>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:with-param name="replace" select="$replace"/>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:with-param name="with" select="$with"/>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive </xsl:call-template>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive </xsl:otherwise>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive </xsl:choose>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive</xsl:template>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<!-- ==================================================================== -->
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<!-- Take care of all the LaTeX special characters. -->
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<!-- Silly multi-variable technique used to avoid deep recursion. -->
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<!-- ==================================================================== -->
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:template match="text()">
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:call-template name="ltescape">
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:with-param name="string" select="."/>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive</xsl:call-template>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive</xsl:template>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:template name="ltescape">
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:param name="string"/>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:variable name="result1">
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:choose>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:when test="contains($string, '\')">
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:call-template name="replace-string">
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:with-param name="replace" select="'\'"/>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:with-param name="with" select="'\textbackslash '"/>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:with-param name="text" select="normalize-space($string)"/>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive </xsl:call-template>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive </xsl:when>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:otherwise>
46d1ef8cb385aa2f519ce7d355afc51f144bd938slive <xsl:value-of select="$string"/>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive </xsl:otherwise>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive </xsl:choose>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive</xsl:variable>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:variable name="result2">
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:choose>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:when test="contains($result1, '$')">
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:call-template name="replace-string">
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:with-param name="replace" select="'$'"/>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:with-param name="with" select="'\$'"/>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:with-param name="text" select="$result1"/>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive </xsl:call-template>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive </xsl:when>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:otherwise>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:value-of select="$result1"/>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive </xsl:otherwise>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive </xsl:choose>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive</xsl:variable>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:variable name="result3">
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:choose>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:when test="contains($result2, '{')">
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:call-template name="replace-string">
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:with-param name="replace" select="'{'"/>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:with-param name="with" select="'\{'"/>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:with-param name="text" select="$result2"/>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive </xsl:call-template>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive </xsl:when>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:otherwise>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:value-of select="$result2"/>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive </xsl:otherwise>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive </xsl:choose>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive</xsl:variable>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:variable name="result4">
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:choose>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:when test="contains($result3, '}')">
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:call-template name="replace-string">
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:with-param name="replace" select="'}'"/>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:with-param name="with" select="'\}'"/>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:with-param name="text" select="$result3"/>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive </xsl:call-template>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive </xsl:when>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:otherwise>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:value-of select="$result3"/>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive </xsl:otherwise>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive </xsl:choose>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive</xsl:variable>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive
1cb160a981947e75a8353da3fe40a653aa87100eslive<!-- The '[' and ']' characters don't, in general, need to be
1cb160a981947e75a8353da3fe40a653aa87100eslive escaped. But there are times when it is ambiguous whether
1cb160a981947e75a8353da3fe40a653aa87100eslive [ is the beginning of an optional argument or a literal '['.
1cb160a981947e75a8353da3fe40a653aa87100eslive Hence, it is safer to protect the literal ones with {}. -->
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:variable name="result5">
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:choose>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:when test="contains($result4, '[')">
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:call-template name="replace-string">
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:with-param name="replace" select="'['"/>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:with-param name="with" select="'{[}'"/>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:with-param name="text" select="$result4"/>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive </xsl:call-template>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive </xsl:when>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:otherwise>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:value-of select="$result4"/>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive </xsl:otherwise>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive </xsl:choose>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive</xsl:variable>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:variable name="result6">
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:choose>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:when test="contains($result5, ']')">
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:call-template name="replace-string">
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:with-param name="replace" select="']'"/>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:with-param name="with" select="'{]}'"/>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:with-param name="text" select="$result5"/>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive </xsl:call-template>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive </xsl:when>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:otherwise>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:value-of select="$result5"/>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive </xsl:otherwise>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive </xsl:choose>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive</xsl:variable>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive
368bcafaedaee463f769c1b5f3547b9970df90d0slive<xsl:variable name="result7">
368bcafaedaee463f769c1b5f3547b9970df90d0slive <xsl:choose>
368bcafaedaee463f769c1b5f3547b9970df90d0slive <xsl:when test="contains($result6, '&quot;')">
368bcafaedaee463f769c1b5f3547b9970df90d0slive <xsl:call-template name="replace-string">
368bcafaedaee463f769c1b5f3547b9970df90d0slive <xsl:with-param name="replace" select="'&quot;'"/>
368bcafaedaee463f769c1b5f3547b9970df90d0slive <xsl:with-param name="with" select="'\texttt{&quot;}'"/>
368bcafaedaee463f769c1b5f3547b9970df90d0slive <xsl:with-param name="text" select="$result6"/>
368bcafaedaee463f769c1b5f3547b9970df90d0slive </xsl:call-template>
368bcafaedaee463f769c1b5f3547b9970df90d0slive </xsl:when>
368bcafaedaee463f769c1b5f3547b9970df90d0slive <xsl:otherwise>
368bcafaedaee463f769c1b5f3547b9970df90d0slive <xsl:value-of select="$result6"/>
368bcafaedaee463f769c1b5f3547b9970df90d0slive </xsl:otherwise>
368bcafaedaee463f769c1b5f3547b9970df90d0slive </xsl:choose>
368bcafaedaee463f769c1b5f3547b9970df90d0slive</xsl:variable>
368bcafaedaee463f769c1b5f3547b9970df90d0slive
368bcafaedaee463f769c1b5f3547b9970df90d0slive
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:call-template name="replace-string">
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:with-param name="replace" select="'_'"/>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:with-param name="with" select="'\_'"/>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:with-param name="text">
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:call-template name="replace-string">
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:with-param name="replace" select="'#'"/>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:with-param name="with" select="'\#'"/>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:with-param name="text">
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:call-template name="replace-string">
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:with-param name="replace" select="'%'"/>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:with-param name="with" select="'\%'"/>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:with-param name="text">
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:call-template name="replace-string">
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:with-param name="replace" select="'&gt;'"/>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:with-param name="with" select="'\textgreater{}'"/>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:with-param name="text">
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:call-template name="replace-string">
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:with-param name="replace" select="'&lt;'"/>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:with-param name="with" select="'\textless{}'"/>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:with-param name="text">
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:call-template name="replace-string">
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:with-param name="replace" select="'~'"/>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:with-param name="with" select="'\textasciitilde{}'"/>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:with-param name="text">
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:call-template name="replace-string">
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:with-param name="replace" select="'^'"/>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:with-param name="with" select="'\^{}'"/>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:with-param name="text">
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:call-template name="replace-string">
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:with-param name="replace" select="'&amp;'"/>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:with-param name="with" select="'\&amp;'"/>
368bcafaedaee463f769c1b5f3547b9970df90d0slive <xsl:with-param name="text" select="$result7"/>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive </xsl:call-template>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive </xsl:with-param>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive </xsl:call-template>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive </xsl:with-param>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive </xsl:call-template>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive </xsl:with-param>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive </xsl:call-template>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive </xsl:with-param>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive </xsl:call-template>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive </xsl:with-param>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive </xsl:call-template>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive </xsl:with-param>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive </xsl:call-template>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive </xsl:with-param>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive </xsl:call-template>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive</xsl:template>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive</xsl:stylesheet>