]> granicus.if.org Git - apache/blob - docs/manual/style/xsl/sitemap.xsl
Help doc writer to spot places where:
[apache] / docs / manual / style / xsl / sitemap.xsl
1 <?xml version="1.0"?>
2
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
10
11      http://www.apache.org/licenses/LICENSE-2.0
12
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 -->
19
20 <!DOCTYPE xsl:stylesheet [
21     <!ENTITY lf SYSTEM "util/lf.xml">
22 ]>
23 <xsl:stylesheet version="1.0"
24               xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
25                   xmlns="http://www.w3.org/1999/xhtml">
26
27 <!-- ==================================================================== -->
28 <!-- <sitemap>                                                            -->
29 <!-- Process an entire document into an HTML page                         -->
30 <!-- ==================================================================== -->
31 <xsl:template match="/sitemap">
32 <html xml:lang="{$doclang}" lang="{$doclang}">
33     <xsl:call-template name="head" />&lf;
34
35     <body id="manual-page">&lf;
36         <xsl:call-template name="top" />&lf;
37
38         <div id="page-content">
39             <xsl:call-template name="retired" />
40
41             <div id="preamble">        
42                 <h1>
43                     <xsl:value-of select="title" />
44                 </h1>&lf;
45
46                 <xsl:call-template name="langavail" />&lf;
47
48                 <xsl:apply-templates select="summary" />
49             </div>&lf; <!-- /#preamble -->
50           
51             <xsl:if test="(not($is-chm) and count(category) &gt; 1) or seealso">
52                 <div id="quickview">
53                     <xsl:if test="not($is-chm) and count(category) &gt; 1">
54                         <ul id="toc">&lf;
55                         <xsl:for-each select="category">
56                             <xsl:choose>
57                             <xsl:when test="@id">
58                                 <li>
59                                     <img src="{$path}/images/down.gif" alt="" />
60                                     <xsl:text> </xsl:text>
61                                     <a href="#{@id}">
62                                         <xsl:apply-templates
63                                             select="title" mode="print" />
64                                     </a>
65                                 </li>&lf;
66                             </xsl:when>
67                             <xsl:otherwise>
68                                 <li>
69                                     <img src="{$path}/images/down.gif" alt="" />
70                                     <xsl:text> </xsl:text>
71                                     <xsl:apply-templates
72                                         select="title" mode="print" />
73                                 </li>&lf;
74                             </xsl:otherwise>
75                             </xsl:choose>
76                         </xsl:for-each>
77                         </ul>&lf;
78                     </xsl:if>
79
80                     <xsl:if test="seealso">
81                         <h3>
82                             <xsl:value-of select="$message
83                                                   [@id='seealso']" />
84                         </h3>&lf;
85
86                         <ul class="seealso">&lf;
87                         <xsl:for-each select="seealso">
88                             <li>
89                                 <xsl:apply-templates />
90                             </li>&lf;
91                         </xsl:for-each>
92                         </ul>&lf;
93                     </xsl:if>
94                     </div>&lf; <!-- /#quickview -->
95             </xsl:if> <!-- have sidebar -->
96
97             <xsl:apply-templates select="category" />
98         </div>&lf; <!-- /#page-content -->
99
100         <xsl:call-template name="bottom" />&lf;
101     </body>
102 </html>
103 </xsl:template>
104 <!-- /sitemap -->
105   
106
107 <!-- ==================================================================== -->
108 <!-- category/page                                                        -->
109 <!-- ==================================================================== -->
110 <xsl:template match="sitemap/category/page">
111 <li>
112     <xsl:if test="@separate='yes'">
113         <xsl:attribute name="class">separate</xsl:attribute>
114     </xsl:if>
115
116     <xsl:choose>
117     <xsl:when test="@href">
118         <a href="{@href}">
119             <xsl:call-template name="helper.uri.fix">
120                 <xsl:with-param name="uri" select="@href" />
121             </xsl:call-template>
122             <xsl:value-of select="." />
123         </a>
124     </xsl:when>
125     <xsl:otherwise>
126         <xsl:value-of select="." />
127     </xsl:otherwise>
128     </xsl:choose>
129 </li>&lf;
130 </xsl:template>
131 <!-- /category/page -->
132
133
134 <!-- ==================================================================== -->
135 <!-- Process a sitemap category                                           -->
136 <!-- ==================================================================== -->
137 <xsl:template match="sitemap/category">
138 <xsl:call-template name="toplink" />&lf;
139
140 <div class="section">
141     <!-- Category title -->
142     <h2>
143         <xsl:choose>
144         <xsl:when test="@id">
145             <a id="{@id}" name="{@id}">
146                 <xsl:apply-templates select="title" mode="print" />
147             </a>
148         </xsl:when>
149         <xsl:otherwise>
150             <xsl:apply-templates select="title" mode="print" />
151         </xsl:otherwise>
152         </xsl:choose>
153     </h2>&lf;
154
155     <!-- category body -->
156     <ul>
157         <xsl:apply-templates select="page" />
158     </ul>
159       
160     <!-- optional ... -->
161     <xsl:if test="@id = 'modules'">
162         <xsl:apply-templates select="document($allmodules)/modulefilelist" />
163     </xsl:if>
164     &lf;
165 </div> <!-- /.section -->
166 </xsl:template>
167 <!-- /category -->
168
169
170 <!-- ==================================================================== -->
171 <!-- category/modulefilelist                                              -->
172 <!-- insert module list into sitemap                                      -->
173 <!-- ==================================================================== -->
174 <xsl:template match="modulefilelist">
175 <xsl:variable name="translist">
176     <xsl:text>-</xsl:text>
177     <xsl:for-each select="modulefile">
178         <xsl:variable name="current" select="document(.)/modulesynopsis" />
179    
180         <xsl:text> </xsl:text>
181         <xsl:value-of select="$current/name" />
182         <xsl:text> </xsl:text>
183         <xsl:call-template name="module-translatename">
184             <xsl:with-param name="name" select="$current/name" />
185         </xsl:call-template>
186         <xsl:text> -</xsl:text>
187     </xsl:for-each>
188 </xsl:variable>
189
190 <ul>
191 <li>
192     <a href="mod/core.html">
193         <xsl:value-of select="$message[@id='apachecore']" />
194     </a>
195 </li>&lf;
196 <li>
197     <a href="mod/mpm_common.html">
198         <xsl:value-of select="$message[@id='apachempmcommon']" />
199     </a>
200 </li>&lf;
201
202 <xsl:for-each select="modulefile">
203 <xsl:sort select="substring-before(substring-after($translist, concat('- ',
204                   document(.)/modulesynopsis/name, ' ')), ' -')" />
205
206     <xsl:variable name="current" select="document(.)/modulesynopsis" />
207
208     <xsl:if test="$current/status='MPM' and $current/name!='mpm_common'">
209         <xsl:variable name="name" select="substring-before(substring-after(
210                         $translist, concat('- ', $current/name, ' ')), ' -')" />
211
212         <li>
213             <a href="mod/{$current/name}.html">
214                 <xsl:value-of select="$message[@id='apachempm']" />
215                 <xsl:text> </xsl:text>
216                 <xsl:value-of select="$name" />
217             </a>
218         </li>&lf;
219     </xsl:if>
220 </xsl:for-each>
221 </ul>
222
223 <ul>
224 <xsl:for-each select="modulefile">
225 <xsl:sort select="substring-before(substring-after($translist, concat('- ',
226                   document(.)/modulesynopsis/name, ' ')), ' -')"/>
227
228     <xsl:variable name="current" select="document(.)/modulesynopsis" />
229
230     <xsl:if test="$current/status!='MPM' and $current/status!='Core'">
231         <li>
232             <a href="mod/{$current/name}.html">
233                 <xsl:value-of select="$message[@id='apachemodule']"/>
234                 <xsl:text> </xsl:text>
235                 <xsl:value-of select="$current/name"/>
236             </a>
237         </li>&lf;
238     </xsl:if>
239 </xsl:for-each>
240 </ul>
241 </xsl:template>
242 <!-- /category/modulefilelist -->
243
244 </xsl:stylesheet>