Moved apache code into a folder to help prepare for packaging where we dont want...
[httpd-crcsyncproxy.git] / apache / docs / manual / style / latex / moduleindex.xsl
blob2824d6078fc38ad9138a4a0576d7ab86db1e6145
1 <?xml version="1.0"?>
3 <!--
4 Licensed to the Apache Software Foundation (ASF) under one or more
5 contributor license agreements. See the NOTICE file distributed with
6 this work for additional information regarding copyright ownership.
7 The ASF licenses this file to You under the Apache License, Version 2.0
8 (the "License"); you may not use this file except in compliance with
9 the License. You may obtain a copy of the License at
11 http://www.apache.org/licenses/LICENSE-2.0
13 Unless required by applicable law or agreed to in writing, software
14 distributed under the License is distributed on an "AS IS" BASIS,
15 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 See the License for the specific language governing permissions and
17 limitations under the License.
18 -->
20 <xsl:stylesheet version="1.0"
21 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
22 xmlns="http://www.w3.org/1999/xhtml">
24 <!-- ==================================================================== -->
25 <!-- <moduleindex> -->
26 <!-- Builds the moduleindex page -->
27 <!-- ==================================================================== -->
28 <xsl:template match="moduleindex">
30 <xsl:variable name="metafile" select="document(/*/@metafile)/metafile" />
32 <xsl:call-template name="section-title"/>
34 <xsl:apply-templates select="summary"/>
36 <xsl:call-template name="seealso"/>
38 <xsl:text>\subsection*{</xsl:text>
39 <xsl:value-of select="$message[@id='corefeatures']" />
40 <xsl:text>}
42 \begin{description}
43 \item[</xsl:text>
44 <xsl:apply-templates select="document(document($allmodules)/modulefilelist/modulefile
45 [starts-with(., 'core.xml')])
46 /modulesynopsis/name"/>
47 <xsl:text>] (p.\ \pageref{/mod/</xsl:text>
48 <xsl:value-of select="document(document($allmodules)/modulefilelist/modulefile
49 [starts-with(., 'core.xml')])
50 /modulesynopsis/name"/>
51 <xsl:text>}) </xsl:text>
53 <xsl:apply-templates select="document(document($allmodules)/modulefilelist/modulefile
54 [starts-with(., 'core.xml')])
55 /modulesynopsis/description" />
57 <xsl:text>
58 \item[</xsl:text>
60 <xsl:apply-templates select="document(document($allmodules)/modulefilelist/modulefile
61 [starts-with(., 'mpm_common.xml')])
62 /modulesynopsis/name" />
63 <xsl:text>] (p.\ \pageref{/mod/</xsl:text>
64 <xsl:value-of select="document(document($allmodules)/modulefilelist/modulefile
65 [starts-with(., 'mpm_common.xml')])
66 /modulesynopsis/name"/>
67 <xsl:text>}) </xsl:text>
68 <xsl:apply-templates select="document(document($allmodules)/modulefilelist/modulefile
69 [starts-with(., 'mpm_common.xml')])
70 /modulesynopsis/description" />
74 <!-- and now the remaining MPMs -->
75 <xsl:variable name="mpmmodules"
76 select="document(document($allmodules)/modulefilelist/modulefile)
77 /modulesynopsis[status='MPM' and name != 'mpm_common']" />
78 <xsl:variable name="translist">
79 <xsl:call-template name="module-translist">
80 <xsl:with-param name="modules" select="$mpmmodules" />
81 </xsl:call-template>
82 </xsl:variable>
84 <xsl:for-each select="$mpmmodules">
85 <xsl:sort select="substring-before(substring-after($translist,
86 concat('- ', translate(normalize-space(name), $lowercase,
87 $uppercase), ' ')), ' -')" />
89 <xsl:text>
90 \item[</xsl:text>
91 <xsl:apply-templates select="name"/>
92 <xsl:text>] (p.\ \pageref{/mod/</xsl:text>
93 <xsl:value-of select="name"/>
94 <xsl:text>}) </xsl:text>
96 <xsl:apply-templates select="description" />
98 </xsl:for-each>
100 <xsl:text>\end{description}
102 </xsl:text>
104 <!-- /core section -->
106 <xsl:text>\section*{</xsl:text>
107 <xsl:value-of select="$message[@id='othermodules']" />
108 <xsl:text>}
109 \begin{description}
110 </xsl:text>
112 <xsl:variable name="modules"
113 select="document(document($allmodules)/modulefilelist/modulefile)
114 /modulesynopsis[status!='MPM' and status!='Core']" />
116 <xsl:call-template name="mindex-of-letter">
117 <xsl:with-param name="modules" select="$modules" />
118 </xsl:call-template>
120 <xsl:text>\end{description}
121 </xsl:text>
122 </xsl:template>
123 <!-- /moduleindex -->
126 <!-- ==================================================================== -->
127 <!-- the working horse. builds list items of all modules starting with -->
128 <!-- one letter when done, it calls itself to catch the next letter -->
129 <!-- ==================================================================== -->
130 <xsl:template name="mindex-of-letter">
131 <xsl:param name="modules"/>
133 <xsl:variable name="translist">
134 <xsl:call-template name="module-translist">
135 <xsl:with-param name="modules" select="$modules" />
136 </xsl:call-template>
137 </xsl:variable>
139 <xsl:for-each select="$modules">
140 <xsl:sort
141 select="substring-before(substring-after($translist, concat('- ',
142 translate(normalize-space(name),$lowercase,$uppercase), ' ')), ' -')" />
144 <xsl:text>
145 \item[</xsl:text>
146 <xsl:apply-templates select="name"/>
147 <xsl:text>] (p.\ \pageref{/mod/</xsl:text>
148 <xsl:value-of select="name"/>
149 <xsl:text>}) </xsl:text>
151 <xsl:apply-templates select="description" />
153 </xsl:for-each> <!-- /directives -->
155 </xsl:template>
156 <!-- /mindex-of-letter -->
158 <!-- ==================================================================== -->
159 <!-- define module name translations for sorting -->
160 <!-- -->
161 <!-- it's a kind of a hack... -->
162 <!-- we build a string that contains the following data: -->
163 <!-- "- modulename sortname - modulename sortname - ..." -->
164 <!-- (with all data in uppercase) -->
165 <!-- -->
166 <!-- So, the translation from modulename to sortname can be done with the -->
167 <!-- expression below: -->
168 <!--
169 substring-before(
170 substring-after($translist,
171 concat('- ', translate(modulename,
172 $lowercase, $uppercase),
173 ' ')
175 ' -')
177 <!-- ==================================================================== -->
178 <xsl:template name="module-translist">
179 <xsl:param name="modules" />
181 <xsl:text>-</xsl:text>
182 <xsl:for-each select="$modules">
183 <xsl:variable name="sname" select="translate(normalize-space(name),
184 $lowercase, $uppercase)" />
186 <xsl:text> </xsl:text>
187 <xsl:value-of select="$sname" />
188 <xsl:text> </xsl:text>
189 <xsl:call-template name="module-translatename">
190 <xsl:with-param name="name" select="$sname" />
191 </xsl:call-template>
192 <xsl:text> -</xsl:text>
193 </xsl:for-each>
194 </xsl:template>
195 <!-- /module-translist -->
197 <xsl:template name="module-translatename">
198 <xsl:param name="name" />
200 <xsl:variable name="sname" select="translate($name, $lowercase, $uppercase)" />
202 <xsl:choose>
203 <xsl:when test="starts-with($sname, 'MOD_') or starts-with($sname, 'MPM_')">
204 <xsl:value-of select="substring($name, 5)" />
205 </xsl:when>
207 <xsl:when test="starts-with($sname, 'MPMT_')">
208 <xsl:value-of select="substring($name, 6)" />
209 </xsl:when>
211 <xsl:otherwise>
212 <xsl:value-of select="$name" />
213 </xsl:otherwise>
214 </xsl:choose>
215 </xsl:template>
216 <!-- /module-translatename -->
218 </xsl:stylesheet>