home *** CD-ROM | disk | FTP | other *** search
/ Cricao de Sites - 650 Layouts Prontos / WebMasters.iso / Servidores / apache_2.2.8-win32-x86-no_ssl.msi / Data1.cab / latex.xsl (.txt) < prev    next >
LaTeX Document  |  2006-07-11  |  13KB  |  332 lines

  1. <?xml version="1.0" encoding="ISO-8859-1"?>
  2. <!DOCTYPE xsl:stylesheet [
  3.     <!ENTITY % HTTPD-VERSION SYSTEM "../version.ent">
  4.     %HTTPD-VERSION;
  5.  Licensed to the Apache Software Foundation (ASF) under one or more
  6.  contributor license agreements.  See the NOTICE file distributed with
  7.  this work for additional information regarding copyright ownership.
  8.  The ASF licenses this file to You under the Apache License, Version 2.0
  9.  (the "License"); you may not use this file except in compliance with
  10.  the License.  You may obtain a copy of the License at
  11.      http://www.apache.org/licenses/LICENSE-2.0
  12.  Unless required by applicable law or agreed to in writing, software
  13.  distributed under the License is distributed on an "AS IS" BASIS,
  14.  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15.  See the License for the specific language governing permissions and
  16.  limitations under the License.
  17. <xsl:stylesheet version="1.0"
  18.               xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  19. <xsl:output 
  20.   method="text"
  21.   encoding="ISO-8859-1"
  22.   indent="no"
  23. <!-- Read the localized messages from the specified language file -->
  24. <xsl:variable name="message" select="document('../lang/en.xml')
  25.                                      /language/messages/message"/>
  26. <xsl:variable name="allmodules" select="document('../xsl/util/allmodules.xml')
  27.                                         /items/item[@lang='en']"/>
  28. <!-- Get the guts of the stylesheets -->
  29. <xsl:include href="manualpage.xsl" />
  30. <xsl:include href="common.xsl" />
  31. <xsl:include href="html.xsl" />
  32. <xsl:include href="synopsis.xsl" />
  33. <xsl:include href="moduleindex.xsl" />
  34. <xsl:include href="directiveindex.xsl" />
  35. <xsl:include href="faq.xsl" />
  36. <xsl:include href="quickreference.xsl" />
  37. <xsl:template match="sitemap">
  38. <xsl:text>
  39. \documentclass[10pt]{book}
  40. \usepackage{times}
  41. \usepackage{longtable}
  42. \usepackage{style/latex/atbeginend}
  43. \usepackage[pdftex]{graphicx}
  44. \usepackage[colorlinks=true,letterpaper=true,linkcolor=blue,urlcolor=blue]{hyperref}
  45. % Let LaTeX be lenient about very-bad line wrapping.
  46. \tolerance=9999 
  47. \emergencystretch=60pt
  48. % Adjust margins to a reasonable level
  49. \topmargin 0pt
  50. \advance \topmargin by -\headheight
  51. \advance \topmargin by -\headsep
  52. \textheight 8.9in
  53. \oddsidemargin 0pt
  54. \evensidemargin \oddsidemargin
  55. \marginparwidth 0.5in
  56. \textwidth 6.5in
  57. % Keep paragraphs flush left (rather than the default of indenting
  58. % the first line) and put a space between paragraphs.
  59. \setlength{\parindent}{0ex}
  60. \addtolength{\parskip}{1.2ex}
  61. % Shrink the inter-item spaces
  62. \AfterBegin{itemize}{\setlength{\itemsep}{0em}}
  63. \pagestyle{headings}
  64. \hypersetup{
  65.     pdftitle={</xsl:text>
  66. <xsl:value-of select="$message[@id='apache']" />
  67. <xsl:text> </xsl:text>
  68. <xsl:value-of select="$message[@id='http-server']" />
  69. <xsl:text> </xsl:text>
  70. <xsl:value-of select="$message[@id='documentation']" />
  71. <xsl:text> </xsl:text>
  72. <xsl:value-of select="$message[@id='version']" />
  73. <xsl:text>},
  74.     pdfauthor={Apache Software Foundation}
  75. \title{</xsl:text>
  76. <xsl:value-of select="$message[@id='apache']" />
  77. <xsl:text> </xsl:text>
  78. <xsl:value-of select="$message[@id='http-server']" />
  79. <xsl:text> </xsl:text>
  80. <xsl:value-of select="$message[@id='documentation']" />
  81. <xsl:text> </xsl:text>
  82. <xsl:value-of select="$message[@id='version']" />
  83. <xsl:text>\\ \bigskip \bigskip
  84. \includegraphics{images/feather}\\ \bigskip}
  85. \author{Apache Software Foundation}
  86. \date{\today}
  87. \begin{document}
  88. \frontmatter
  89. \maketitle
  90. \section*{About The PDF Documentation}
  91. Copyright \copyright 2005 The Apache Software Foundation
  92. Licensed under the Apache License, Version 2.0 (the "License"); 
  93. you may not use this file except in compliance with the License. 
  94. 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}
  95. This version of the Apache HTTP Server Documentation is converted from
  96. XML source files to \LaTeX\ using XSLT with the help of Apache Ant,
  97. Apache XML Xalan, and Apache XML Xerces.
  98. Since the HTML version of the documentation is more commonly checked
  99. during development, the PDF version may contain some errors and
  100. inconsistencies, especially in formatting.  If you have difficulty
  101. reading a part of this file, please consult the HTML version
  102. of the documentation on the Apache HTTP Server website at
  103. \href{http://httpd.apache.org/docs/&httpd.docs;/}{http://httpd.apache.org/docs/&httpd.docs;/}
  104. The Apache HTTP Server Documentation is maintained by the Apache HTTP
  105. Server Documentation Project.  More information is available at
  106. \href{http://httpd.apache.org/docs-project/}{http://httpd.apache.org/docs-project/}
  107. \tableofcontents
  108. \mainmatter
  109. </xsl:text>
  110. <xsl:for-each select="category">
  111.   <xsl:text>\chapter{</xsl:text>
  112.   <xsl:apply-templates select="title" mode="printcat"/>
  113.   <xsl:text>}
  114. </xsl:text>
  115.     <xsl:apply-templates/>
  116.     <xsl:if test="@id = 'modules'">
  117.         <xsl:apply-templates select="document($allmodules)/modulefilelist" />
  118.     </xsl:if>
  119. </xsl:for-each>
  120. <xsl:text>\end{document}</xsl:text>
  121. </xsl:template>
  122. <xsl:template match="page">
  123. <xsl:text>\include{</xsl:text>
  124. <xsl:choose>
  125. <xsl:when test="contains(@href,'.')">
  126.   <xsl:value-of select="substring-before(@href,'.')"/>
  127. </xsl:when>
  128. <xsl:otherwise>
  129.   <xsl:value-of select="concat(@href,'index')"/>
  130. </xsl:otherwise>
  131. </xsl:choose>
  132. <xsl:text>}
  133. </xsl:text>
  134. </xsl:template>
  135. <xsl:template match="category/title" mode="printcat">
  136. <xsl:apply-templates/>
  137. </xsl:template>
  138. <xsl:template match="category/title"></xsl:template>
  139. <xsl:template match="modulefilelist">
  140. <xsl:apply-templates/>
  141. </xsl:template>
  142. <xsl:template match="modulefile">
  143. <xsl:text>\include{mod/</xsl:text>
  144. <xsl:value-of select="substring-before(.,'.')"/>
  145. <xsl:text>}
  146. </xsl:text>
  147. </xsl:template>
  148. <xsl:template match="summary">
  149. <xsl:apply-templates/>
  150. </xsl:template>
  151. <xsl:template name="replace-string">
  152.   <xsl:param name="text"/>
  153.   <xsl:param name="replace"/>
  154.   <xsl:param name="with"/>
  155.   <xsl:choose>
  156.     <xsl:when test="not(contains($text,$replace))">
  157.       <xsl:value-of select="$text"/>
  158.     </xsl:when>
  159.     <xsl:otherwise>
  160.       <xsl:value-of select="substring-before($text,$replace)"/>
  161.       <xsl:value-of select="$with"/>
  162.       <xsl:call-template name="replace-string">
  163.         <xsl:with-param name="text" select="substring-after($text,$replace)"/>
  164.         <xsl:with-param name="replace" select="$replace"/>
  165.         <xsl:with-param name="with" select="$with"/>
  166.        </xsl:call-template>
  167.      </xsl:otherwise>
  168.    </xsl:choose>
  169. </xsl:template>
  170. <!-- ==================================================================== -->
  171. <!-- Take care of all the LaTeX special characters.                       -->
  172. <!-- Silly multi-variable technique used to avoid deep recursion.         -->
  173. <!-- ==================================================================== -->
  174. <xsl:template match="text()">
  175. <xsl:call-template name="ltescape">
  176.   <xsl:with-param name="string" select="."/>
  177. </xsl:call-template>
  178. </xsl:template>
  179. <xsl:template name="ltescape">
  180. <xsl:param name="string"/>
  181. <xsl:variable name="result1">
  182.  <xsl:choose>
  183.  <xsl:when test="contains($string, '\')">
  184.    <xsl:call-template name="replace-string">
  185.     <xsl:with-param name="replace" select="'\'"/>
  186.     <xsl:with-param name="with" select="'\textbackslash '"/>
  187.     <xsl:with-param name="text" select="normalize-space($string)"/>
  188.    </xsl:call-template>
  189.  </xsl:when>
  190.  <xsl:otherwise>
  191.    <xsl:value-of select="$string"/>
  192.  </xsl:otherwise>
  193.  </xsl:choose>
  194. </xsl:variable>
  195. <xsl:variable name="result2">
  196.  <xsl:choose>
  197.  <xsl:when test="contains($result1, '$')">
  198.    <xsl:call-template name="replace-string">
  199.     <xsl:with-param name="replace" select="'$'"/>
  200.     <xsl:with-param name="with" select="'\$'"/>
  201.     <xsl:with-param name="text" select="$result1"/>
  202.    </xsl:call-template>
  203.  </xsl:when>
  204.  <xsl:otherwise>
  205.    <xsl:value-of select="$result1"/>
  206.  </xsl:otherwise>
  207.  </xsl:choose>
  208. </xsl:variable>
  209. <xsl:variable name="result3">
  210.  <xsl:choose>
  211.  <xsl:when test="contains($result2, '{')">
  212.    <xsl:call-template name="replace-string">
  213.     <xsl:with-param name="replace" select="'{'"/>
  214.     <xsl:with-param name="with" select="'\{'"/>
  215.     <xsl:with-param name="text" select="$result2"/>
  216.    </xsl:call-template>
  217.  </xsl:when>
  218.  <xsl:otherwise>
  219.    <xsl:value-of select="$result2"/>
  220.  </xsl:otherwise>
  221.  </xsl:choose>
  222. </xsl:variable>
  223. <xsl:variable name="result4">
  224.  <xsl:choose>
  225.  <xsl:when test="contains($result3, '}')">
  226.    <xsl:call-template name="replace-string">
  227.     <xsl:with-param name="replace" select="'}'"/>
  228.     <xsl:with-param name="with" select="'\}'"/>
  229.     <xsl:with-param name="text" select="$result3"/>
  230.    </xsl:call-template>
  231.  </xsl:when>
  232.  <xsl:otherwise>
  233.    <xsl:value-of select="$result3"/>
  234.  </xsl:otherwise>
  235.  </xsl:choose>
  236. </xsl:variable>
  237. <!-- The '[' and ']' characters don't, in general, need to be
  238.   escaped.  But there are times when it is ambiguous whether
  239.   [ is the beginning of an optional argument or a literal '['.
  240.   Hence, it is safer to protect the literal ones with {}. -->
  241. <xsl:variable name="result5">
  242.  <xsl:choose>
  243.  <xsl:when test="contains($result4, '[')">
  244.    <xsl:call-template name="replace-string">
  245.     <xsl:with-param name="replace" select="'['"/>
  246.     <xsl:with-param name="with" select="'{[}'"/>
  247.     <xsl:with-param name="text" select="$result4"/>
  248.    </xsl:call-template>
  249.  </xsl:when>
  250.  <xsl:otherwise>
  251.    <xsl:value-of select="$result4"/>
  252.  </xsl:otherwise>
  253.  </xsl:choose>
  254. </xsl:variable>
  255. <xsl:variable name="result6">
  256.  <xsl:choose>
  257.  <xsl:when test="contains($result5, ']')">
  258.    <xsl:call-template name="replace-string">
  259.     <xsl:with-param name="replace" select="']'"/>
  260.     <xsl:with-param name="with" select="'{]}'"/>
  261.     <xsl:with-param name="text" select="$result5"/>
  262.    </xsl:call-template>
  263.  </xsl:when>
  264.  <xsl:otherwise>
  265.    <xsl:value-of select="$result5"/>
  266.  </xsl:otherwise>
  267.  </xsl:choose>
  268. </xsl:variable>
  269. <xsl:variable name="result7">
  270.  <xsl:choose>
  271.  <xsl:when test="contains($result6, '"')">
  272.    <xsl:call-template name="replace-string">
  273.     <xsl:with-param name="replace" select="'"'"/>
  274.     <xsl:with-param name="with" select="'\texttt{"}'"/>
  275.     <xsl:with-param name="text" select="$result6"/>
  276.    </xsl:call-template>
  277.  </xsl:when>
  278.  <xsl:otherwise>
  279.    <xsl:value-of select="$result6"/>
  280.  </xsl:otherwise>
  281.  </xsl:choose>
  282. </xsl:variable>
  283.     <xsl:call-template name="replace-string">
  284.     <xsl:with-param name="replace" select="'_'"/>
  285.     <xsl:with-param name="with" select="'\_'"/>
  286.     <xsl:with-param name="text">
  287.       <xsl:call-template name="replace-string">
  288.       <xsl:with-param name="replace" select="'#'"/>
  289.       <xsl:with-param name="with" select="'\#'"/>
  290.       <xsl:with-param name="text">
  291.         <xsl:call-template name="replace-string">
  292.         <xsl:with-param name="replace" select="'%'"/>
  293.         <xsl:with-param name="with" select="'\%'"/>
  294.         <xsl:with-param name="text">
  295.           <xsl:call-template name="replace-string">
  296.           <xsl:with-param name="replace" select="'>'"/>
  297.           <xsl:with-param name="with" select="'\textgreater{}'"/>
  298.           <xsl:with-param name="text">
  299.             <xsl:call-template name="replace-string">
  300.             <xsl:with-param name="replace" select="'<'"/>
  301.             <xsl:with-param name="with" select="'\textless{}'"/>
  302.             <xsl:with-param name="text">
  303.               <xsl:call-template name="replace-string">
  304.               <xsl:with-param name="replace" select="'~'"/>
  305.               <xsl:with-param name="with" select="'\textasciitilde{}'"/>
  306.               <xsl:with-param name="text">
  307.                 <xsl:call-template name="replace-string">
  308.                 <xsl:with-param name="replace" select="'^'"/>
  309.                 <xsl:with-param name="with" select="'\^{}'"/>
  310.                 <xsl:with-param name="text">
  311.                     <xsl:call-template name="replace-string">
  312.                     <xsl:with-param name="replace" select="'&'"/>
  313.                     <xsl:with-param name="with" select="'\&'"/>
  314.                     <xsl:with-param name="text" select="$result7"/>
  315.                     </xsl:call-template>
  316.                 </xsl:with-param>
  317.                 </xsl:call-template>
  318.               </xsl:with-param>
  319.               </xsl:call-template>
  320.             </xsl:with-param>
  321.             </xsl:call-template>
  322.           </xsl:with-param>
  323.           </xsl:call-template>
  324.         </xsl:with-param>
  325.         </xsl:call-template>
  326.       </xsl:with-param>
  327.       </xsl:call-template>
  328.     </xsl:with-param>
  329.     </xsl:call-template>
  330. </xsl:template>
  331. </xsl:stylesheet>
  332.