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 / _6DBE6589C8BAD0B7722DF9C1D0C6938D (.txt) < prev    next >
LaTeX Document  |  2006-07-11  |  9KB  |  213 lines

  1. <?xml version="1.0"?>
  2.  Licensed to the Apache Software Foundation (ASF) under one or more
  3.  contributor license agreements.  See the NOTICE file distributed with
  4.  this work for additional information regarding copyright ownership.
  5.  The ASF licenses this file to You under the Apache License, Version 2.0
  6.  (the "License"); you may not use this file except in compliance with
  7.  the License.  You may obtain a copy of the License at
  8.      http://www.apache.org/licenses/LICENSE-2.0
  9.  Unless required by applicable law or agreed to in writing, software
  10.  distributed under the License is distributed on an "AS IS" BASIS,
  11.  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12.  See the License for the specific language governing permissions and
  13.  limitations under the License.
  14. <xsl:stylesheet version="1.0"
  15.               xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  16.                   xmlns="http://www.w3.org/1999/xhtml">
  17. <!-- Constants used for case translation -->
  18. <xsl:variable name="lowercase" select="'abcdefghijklmnopqrstuvwxyz'" />
  19. <xsl:variable name="uppercase" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'" />
  20. <!-- ==================================================================== -->
  21. <!-- Process a documentation section                                      -->
  22. <!-- ==================================================================== -->
  23. <xsl:template match="section">
  24. <xsl:apply-templates/>
  25. </xsl:template>
  26. <xsl:template match="section/title">
  27. <xsl:text>\subsection*{</xsl:text>
  28. <xsl:apply-templates/>
  29. <xsl:text>}</xsl:text><xsl:call-template name="label"/>
  30. <xsl:text>
  31. </xsl:text>
  32. </xsl:template>
  33. <xsl:template match="section/section/title">
  34. <xsl:text>\subsubsection*{</xsl:text>
  35. <xsl:apply-templates/>
  36. <xsl:text>}</xsl:text><xsl:call-template name="label"/>
  37. <xsl:text>
  38. </xsl:text>
  39. </xsl:template>
  40. <xsl:template match="section/section/section/title">
  41. <xsl:text>\subsubsection*{</xsl:text>
  42. <xsl:apply-templates/>
  43. <xsl:text>}</xsl:text><xsl:call-template name="label"/>
  44. <xsl:text>
  45. </xsl:text>
  46. </xsl:template>
  47. <xsl:template match="note/title"></xsl:template>
  48. <xsl:template match="example/title"></xsl:template>
  49. <xsl:template name="label">
  50. <xsl:if test="../@id">
  51. <xsl:variable name="metafile" select="document(/*/@metafile)/metafile" />
  52. <xsl:text>\label{</xsl:text><xsl:value-of 
  53. select="$metafile/path"/><xsl:value-of 
  54. select="$metafile/basename"/>
  55. <xsl:text>:</xsl:text>
  56. <xsl:value-of select="../@id"/>
  57. <xsl:text>}</xsl:text>
  58. </xsl:if>
  59. </xsl:template>
  60. <!-- ==================================================================== -->
  61. <!-- <example>                                                            -->
  62. <!-- ==================================================================== -->
  63. <!-- verbatim inside of fbox doesn't work for some reason -->
  64. <xsl:template match="example">
  65. <xsl:text>\par\smallskip\begin{center}</xsl:text>
  66. <xsl:if test="not(pre)"><xsl:text>\fbox{</xsl:text></xsl:if>
  67. <xsl:text>\begin{minipage}{.8\textwidth}\begin{flushleft}</xsl:text>
  68. <xsl:apply-templates select="title" mode="print" />
  69. <xsl:text>{\ttfamily\small </xsl:text>
  70. <xsl:text>\noindent </xsl:text><xsl:apply-templates/>
  71. <xsl:text>}</xsl:text>
  72. <xsl:text>\end{flushleft}\end{minipage}</xsl:text>
  73. <xsl:if test="not(pre)"><xsl:text>}</xsl:text></xsl:if>
  74. <xsl:text>\end{center}\par\smallskip</xsl:text>
  75. </xsl:template>
  76. <xsl:template match="example/title" mode="print">
  77. <xsl:text>\textbf{</xsl:text>
  78.     <xsl:apply-templates/>
  79. <xsl:text>}\\ </xsl:text>
  80. </xsl:template>
  81. <!-- ==================================================================== -->
  82. <!-- indentations                                                         -->
  83. <!-- ==================================================================== -->
  84. <xsl:template match="indent">
  85. <xsl:text>\begin{list}{}{\topsep 0pt\rightmargin 0pt\leftmargin 2em}
  86. \item[] </xsl:text>
  87. <xsl:apply-templates/>
  88. <xsl:text>\end{list}</xsl:text>
  89. </xsl:template>
  90. <!-- ==================================================================== -->
  91. <!-- <note>                                                               -->
  92. <!-- ==================================================================== -->
  93. <xsl:template match="note">
  94. <xsl:text>\par\smallskip
  95. {\Huge </xsl:text>
  96. <xsl:choose>
  97. <xsl:when test="@type='warning'">
  98.   <xsl:text>\fbox{!} </xsl:text>
  99. </xsl:when>
  100. <xsl:otherwise>
  101.   <xsl:text>$\Longrightarrow$</xsl:text>
  102. </xsl:otherwise>
  103. </xsl:choose>
  104. <xsl:text>}\begin{minipage}[t]{.8\textwidth}
  105. \noindent </xsl:text>
  106. <xsl:apply-templates select="title" mode="print" />
  107. <xsl:apply-templates/>
  108. <xsl:text>\end{minipage}\par\smallskip</xsl:text>
  109. </xsl:template>
  110. <xsl:template match="note/title" mode="print">
  111. <xsl:text>\textbf{</xsl:text>
  112.     <xsl:apply-templates/>
  113. <xsl:text>} \\
  114. \noindent </xsl:text>
  115. </xsl:template>
  116. <!-- ==================================================================== -->
  117. <!-- <directive>                                                          -->
  118. <!-- Inserts link to another directive, which might be in another module. -->
  119. <!-- References are converted into lower case.                            -->
  120. <!-- ==================================================================== -->
  121. <xsl:template match="directive" name="directive">
  122. <xsl:text>\textsc{</xsl:text>
  123.    <xsl:if test="@type='section'"><xsl:text>\textless{}</xsl:text></xsl:if>
  124.    <xsl:text>\hyperlink{/mod/</xsl:text>
  125.    <xsl:value-of select="@module"/>
  126.    <xsl:text>:</xsl:text>
  127.    <xsl:value-of select="translate(.,$uppercase,$lowercase)"/>
  128.    <xsl:text>}{</xsl:text>
  129.         <xsl:apply-templates/>
  130.    <xsl:text>}</xsl:text>
  131.    <xsl:if test="@type='section'"><xsl:text>\textgreater{}</xsl:text></xsl:if>
  132. <xsl:text>}</xsl:text>
  133. </xsl:template>
  134. <!-- /directive -->
  135. <!-- ==================================================================== -->
  136. <!-- <module>                                                             -->
  137. <!-- Inserts a link to refereed module                                    -->
  138. <!-- ==================================================================== -->
  139. <xsl:template match="module" name="module">
  140. <xsl:text>\textsc{\hyperlink{/mod/</xsl:text>
  141.   <xsl:value-of select="."/>
  142.   <xsl:text>}{</xsl:text>
  143.     <xsl:apply-templates/>
  144.   <xsl:text>}</xsl:text>
  145. <xsl:text>}</xsl:text>
  146. </xsl:template>
  147. <!-- /module -->
  148. <!-- ==================================================================== -->
  149. <!-- <related>                                                            -->
  150. <!-- ==================================================================== -->
  151. <xsl:template match="related">
  152. <xsl:text>
  153. \fbox{\begin{tabular}{rr}
  154. \begin{minipage}[t]{.49\linewidth}
  155. \textbf{</xsl:text>
  156. <xsl:value-of select="$message[@id='relatedmodules']" />
  157. <xsl:text>} \\
  158. </xsl:text>
  159. <xsl:for-each select="modulelist/module">
  160. <xsl:call-template name="module"/>
  161. <xsl:text> \\
  162. </xsl:text>
  163. </xsl:for-each>
  164. <xsl:text>
  165. \end{minipage} & 
  166. \begin{minipage}[t]{.4\linewidth}
  167. \textbf{</xsl:text>
  168. <xsl:value-of select="$message[@id='relateddirectives']" />
  169. <xsl:text>} \\
  170. </xsl:text>
  171. <xsl:for-each select="directivelist/directive">
  172. <xsl:call-template name="directive"/>
  173. <xsl:text> \\
  174. </xsl:text>
  175. </xsl:for-each>
  176. <xsl:text>
  177. \end{minipage}
  178. \end{tabular}}
  179. \smallskip
  180. </xsl:text>
  181. </xsl:template>
  182. <!-- ==================================================================== -->
  183. <!-- <seealso>                                                            -->
  184. <!-- ==================================================================== -->
  185. <xsl:template name="seealso">
  186.      <xsl:if test="seealso">
  187.     <xsl:text>\textbf{</xsl:text>
  188.         <xsl:value-of select="$message[@id='seealso']" />
  189.         <xsl:text>}\begin{itemize}</xsl:text>
  190.         <xsl:for-each select="seealso">
  191.         <xsl:text>\item </xsl:text>
  192.           <xsl:apply-templates />
  193.         <xsl:text>
  194. </xsl:text>
  195.         </xsl:for-each>
  196. <xsl:text>\end{itemize}</xsl:text>
  197.      </xsl:if>
  198. </xsl:template>
  199. <!-- ==================================================================== -->
  200. <!-- section-title                                                        -->
  201. <!-- ==================================================================== -->
  202. <xsl:template name="section-title">
  203. <xsl:variable name="metafile" select="document(/*/@metafile)/metafile" />
  204. <xsl:text>\section{</xsl:text><xsl:apply-templates select="title"/>
  205. <xsl:text>}</xsl:text>
  206. <xsl:text>\label{</xsl:text><xsl:value-of 
  207. select="$metafile/path"/><xsl:value-of 
  208. select="$metafile/basename"/>
  209. <xsl:text>}
  210. </xsl:text>
  211. </xsl:template>
  212. </xsl:stylesheet>
  213.