~ubuntu-branches/ubuntu/feisty/apache2/feisty

« back to all changes in this revision

Viewing changes to docs/manual/style/xsl/hhc.xsl

  • Committer: Bazaar Package Importer
  • Author(s): Andreas Barth
  • Date: 2006-12-09 21:05:45 UTC
  • mfrom: (0.6.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20061209210545-h70s0xaqc2v8vqr2
Tags: 2.2.3-3.2
* Non-maintainer upload.
* 043_ajp_connection_reuse: Patch from upstream Bugzilla, fixing a critical
  issue with regard to connection reuse in mod_proxy_ajp.
  Closes: #396265

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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 "../xsl/util/lf.xml">
 
22
    <!ENTITY tab SYSTEM "../xsl/util/tab.xml">
 
23
 
 
24
    <!ENTITY ul.start SYSTEM "../xsl/util/ul-start.xml">
 
25
    <!ENTITY ul.end SYSTEM   "../xsl/util/ul-end.xml"  >
 
26
    <!ENTITY li.start SYSTEM "../xsl/util/li-start.xml">
 
27
    <!ENTITY li.end SYSTEM   "../xsl/util/li-end.xml"  >
 
28
]>
 
29
<xsl:stylesheet version="1.0"
 
30
              xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
 
31
                  xmlns="">
 
32
 
 
33
<!--                                                                      -->
 
34
<!-- WARNING! Do not touch anything, especially the whitespaces [1]       -->
 
35
<!-- unless you know, what you're doing. The HTML help compiler parses    -->
 
36
<!-- the TOC file not really as html instead of line by line and takes    -->
 
37
<!-- care of whitespace indentations etc.                                 -->
 
38
<!--                                                                      -->
 
39
<!--   [1] Covered by the &lf; and &tab; entities.                        -->
 
40
<!--                                                                      -->
 
41
<!-- You have been warned.                                                -->
 
42
<!--                                                                      -->
 
43
 
 
44
<!-- create nodeset for referencing later                                 -->
 
45
<xsl:variable name="not-exists" select="document('')/xsl:stylesheet/xsl:template
 
46
                                        [@name='data']/not-exists/file" />
 
47
 
 
48
<xsl:template name="data">
 
49
<!-- documents not converted (yet?). -->
 
50
<not-exists>
 
51
<!--  example: <file>developer/API.xml</file> -->
 
52
</not-exists>
 
53
</xsl:template>
 
54
 
 
55
<!-- Constants used for case translation -->
 
56
<xsl:variable name="lowercase" select="'abcdefghijklmnopqrstuvwxyz'" />
 
57
<xsl:variable name="uppercase" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'" />
 
58
 
 
59
<!-- document() works relative to the xsl (!) file -->
 
60
<xsl:variable name="basedir" select="'../../'"/>
 
61
 
 
62
<!-- icons -->
 
63
<xsl:variable name="icon.document" select="'11'" />
 
64
<xsl:variable name="icon.document.not-translated" select="'12'" />
 
65
<xsl:variable name="icon.section" select="'35'" />
 
66
<xsl:variable name="icon.directive" select="'41'" />
 
67
<xsl:variable name="icon.commondirective" select="'19'" />
 
68
<!-- this should not happen. this icon is only displayed within the
 
69
     toc view of the help workshop (it's a question mark): -->
 
70
<xsl:variable name="icon.no-anchor" select="'9'" />
 
71
 
 
72
<!-- for module-translatename -->
 
73
<xsl:include href="../xsl/util/modtrans.xsl"/>
 
74
 
 
75
<!-- ==================================================================== -->
 
76
<!-- <sitemap>                                                            -->
 
77
<!-- Create CHM contents file (toc) from sitemap                          -->
 
78
<!-- The file is an html style text file (see warning on top)             -->
 
79
<!-- ==================================================================== -->
 
80
<xsl:template match="/sitemap">
 
81
 
 
82
<!-- html head -->
 
83
<xsl:text>&lt;html&gt;&lt;head&gt;</xsl:text>
 
84
<xsl:text>&lt;title&gt;Apache HTTP Server Documentation&lt;/title&gt;</xsl:text>
 
85
<xsl:text>&lt;/head&gt;</xsl:text>&lf;
 
86
 
 
87
<xsl:text>&lt;body&gt;</xsl:text>&lf;
 
88
 
 
89
<!-- toc properties first -->
 
90
<xsl:text>&lt;object type="text/site properties"&gt;</xsl:text>&lf;&tab;
 
91
<!-- XXX: that magic value is still obfuscated. Research needed ... -->
 
92
<xsl:text>&lt;param name="Window Styles" value="0x800027"&gt;</xsl:text>&lf;&tab;
 
93
<xsl:text>&lt;param name="Font" value="</xsl:text>
 
94
    <xsl:value-of select="$toc-font" />
 
95
<xsl:text>"&gt;</xsl:text>&lf;
 
96
<xsl:text>&lt;/object&gt;</xsl:text>&lf;
 
97
 
 
98
&ul.start; &lf;
 
99
 
 
100
    <!-- index page on top. -->
 
101
    &li.start;
 
102
    <xsl:call-template name="object">
 
103
        <xsl:with-param name="name"
 
104
            select="normalize-space($message[@id='apachehttpserver'])" />
 
105
        <xsl:with-param name="href" select="'index.html'" />
 
106
        <xsl:with-param name="indent" select="'&#9;&#9;'" />
 
107
    </xsl:call-template>
 
108
    &li.end; &lf;
 
109
 
 
110
    <!-- iterate over the categories in document order -->
 
111
    <xsl:for-each select="category">
 
112
        &li.start;
 
113
        <xsl:call-template name="folder">
 
114
            <xsl:with-param name="name" select="normalize-space(title)" />
 
115
        </xsl:call-template>&lf;&tab;
 
116
 
 
117
        &ul.start; &lf;&tab;
 
118
            <xsl:apply-templates select="page" />
 
119
            <xsl:if test="@id = 'modules'">
 
120
                <xsl:apply-templates select="document($allmodules)/modulefilelist" />
 
121
            </xsl:if>
 
122
        &ul.end; &lf;
 
123
        &li.end; &lf;&tab;
 
124
    </xsl:for-each>&lf;
 
125
 
 
126
&ul.end; &lf;
 
127
 
 
128
<xsl:text>&lt;/body&gt;&lt;/html&gt;</xsl:text>&lf;
 
129
</xsl:template>
 
130
<!-- /sitemap -->
 
131
 
 
132
 
 
133
<!-- ==================================================================== -->
 
134
<!-- category/page                                                        -->
 
135
<!-- ==================================================================== -->
 
136
<xsl:template match="category/page">
 
137
&li.start;
 
138
 
 
139
<!-- document entry, if not href attribute, assume it means "sitemap" -->
 
140
<xsl:call-template name="object">
 
141
    <xsl:with-param name="name">
 
142
        <xsl:choose>
 
143
        <xsl:when test="@href">
 
144
            <xsl:value-of select="normalize-space(.)" />
 
145
        </xsl:when>
 
146
        <xsl:otherwise>
 
147
            <xsl:value-of select="normalize-space($message[@id='sitemap'])" />
 
148
        </xsl:otherwise>
 
149
        </xsl:choose>
 
150
    </xsl:with-param>
 
151
    <xsl:with-param name="href">
 
152
        <xsl:choose>
 
153
        <xsl:when test="not(@href)">
 
154
            <xsl:text>sitemap.html</xsl:text>
 
155
        </xsl:when>
 
156
        <xsl:when test="contains(@href, '#')">
 
157
            <xsl:value-of select="substring-before(@href, '#')" />
 
158
        </xsl:when>
 
159
        <xsl:otherwise>
 
160
            <xsl:value-of select="@href"/>
 
161
        </xsl:otherwise>
 
162
        </xsl:choose>
 
163
    </xsl:with-param>
 
164
    <xsl:with-param name="indent" select="'&#9;&#9;'" />
 
165
</xsl:call-template>
 
166
 
 
167
<!-- now try to index the sections of the document -->
 
168
<xsl:apply-templates select="self::page" mode="index" />
 
169
 
 
170
&li.end; &lf;&tab;
 
171
</xsl:template>
 
172
<!-- /category/page -->
 
173
 
 
174
 
 
175
<!-- ==================================================================== -->
 
176
<!-- category/page, mode="index"                                          -->
 
177
<!-- display all section headings of one page                             -->
 
178
<!-- ==================================================================== -->
 
179
<xsl:template match="category/page" mode="index">
 
180
<xsl:variable name="href.offline">
 
181
    <xsl:choose>
 
182
    <xsl:when test="string-length(@href) = 0">
 
183
        <xsl:text>sitemap.html</xsl:text>
 
184
    </xsl:when>
 
185
    <xsl:otherwise>
 
186
        <xsl:call-template name="helper.href.offline">
 
187
            <xsl:with-param name="href" select="@href" />
 
188
        </xsl:call-template>
 
189
    </xsl:otherwise>
 
190
    </xsl:choose>
 
191
</xsl:variable>
 
192
<xsl:variable name="xml"
 
193
    select="concat(substring-before($href.offline, '.html'), '.xml')" />
 
194
 
 
195
<xsl:if test="not($xml = $not-exists)">
 
196
    <xsl:variable name="xmlfile">
 
197
        <xsl:variable name="metafile"
 
198
            select="document(document(concat($basedir, $xml))/*/@metafile)
 
199
                    /metafile" />
 
200
        <xsl:choose>
 
201
        <xsl:when test="$metafile/variants/variant[.=$doclang] and not
 
202
                        ($metafile/variants/variant[.=$doclang]
 
203
                         /@htmlonly = 'yes')">
 
204
                <xsl:value-of select="concat($basedir,
 
205
                                   substring-before($xml, '.xml'), $xml-ext)" />
 
206
        </xsl:when>
 
207
        <xsl:otherwise>
 
208
            <xsl:value-of select="concat($basedir, $xml)" />
 
209
        </xsl:otherwise>
 
210
        </xsl:choose>
 
211
    </xsl:variable>
 
212
 
 
213
    <xsl:variable name="current" select="document($xmlfile)" />
 
214
 
 
215
    <xsl:if test="count($current/*/*[local-name()='section' or
 
216
                                     local-name()='category']) &gt; 1">
 
217
        &lf;&tab;&tab;&tab;
 
218
        &ul.start; &lf;&tab;&tab;&tab;
 
219
 
 
220
        <xsl:for-each select="$current/*/*[local-name()='section' or
 
221
                                           local-name()='category']">
 
222
            &li.start;
 
223
 
 
224
            <xsl:call-template name="object">
 
225
                <xsl:with-param name="name" select="normalize-space(title)" />
 
226
                <xsl:with-param name="href">
 
227
                    <xsl:if test="@id">
 
228
                        <xsl:value-of
 
229
                            select="concat(substring-before($xml, '.xml'),
 
230
                                           '.html#', @id)" />
 
231
                    </xsl:if>
 
232
                </xsl:with-param>
 
233
                <xsl:with-param name="indent" select="'&#9;&#9;&#9;&#9;'" />
 
234
            </xsl:call-template>
 
235
 
 
236
            &li.end; &lf;&tab;&tab;
 
237
        </xsl:for-each>
 
238
 
 
239
        &ul.end; &lf;&tab;
 
240
    </xsl:if> <!-- count() > 1 -->
 
241
</xsl:if> <!-- xml exists -->
 
242
</xsl:template>
 
243
<!-- /category/page, "index" -->
 
244
 
 
245
 
 
246
<!-- ==================================================================== -->
 
247
<!-- category/modulefilelist                                              -->
 
248
<!-- process all listed module files                                      -->
 
249
<!-- ==================================================================== -->
 
250
<xsl:template match="modulefilelist">
 
251
<!-- create a module name translation list for sorting -->
 
252
<xsl:variable name="translist">
 
253
    <xsl:text>-</xsl:text>
 
254
 
 
255
    <xsl:for-each select="modulefile">
 
256
        <xsl:variable name="current"
 
257
            select="document(concat($basedir,'mod/',.))/modulesynopsis" />
 
258
   
 
259
        <xsl:text> </xsl:text>
 
260
        <xsl:value-of select="$current/name"/>
 
261
        <xsl:text> </xsl:text>
 
262
        <xsl:call-template name="module-translatename">
 
263
            <xsl:with-param name="name" select="$current/name"/>
 
264
        </xsl:call-template>
 
265
        <xsl:text> -</xsl:text>
 
266
    </xsl:for-each>
 
267
</xsl:variable>
 
268
 
 
269
<!-- put core and mpm_common on top -->
 
270
<xsl:call-template name="toc-entry.mpm">
 
271
    <xsl:with-param name="current"
 
272
        select="document(concat($basedir, 'mod/', modulefile[starts-with(.,
 
273
                         'core.xml')]/text()))/modulesynopsis" />
 
274
    <xsl:with-param name="name" select="'core'" />
 
275
</xsl:call-template>
 
276
 
 
277
<xsl:call-template name="toc-entry.mpm">
 
278
    <xsl:with-param name="current"
 
279
        select="document(concat($basedir, 'mod/', modulefile[starts-with(.,
 
280
                         'mpm_common.xml')]/text()))/modulesynopsis" />
 
281
    <xsl:with-param name="name" select="'common'" />
 
282
</xsl:call-template>
 
283
 
 
284
<!-- remaining MPMs -->
 
285
<xsl:for-each select="modulefile">
 
286
<xsl:sort select="substring-before(substring-after($translist, concat('- ',
 
287
    document(concat($basedir, 'mod/', .))/modulesynopsis/name, ' ')), ' -')" />
 
288
 
 
289
    <xsl:variable name="current"
 
290
        select="document(concat($basedir, 'mod/', .))/modulesynopsis" />
 
291
 
 
292
    <xsl:if test="$current/status='MPM' and not($current/name='mpm_common')">
 
293
        <xsl:call-template name="toc-entry.mpm">
 
294
            <xsl:with-param name="current" select="$current" />
 
295
            <xsl:with-param name="name" select="substring-before(
 
296
                substring-after($translist, concat('- ', $current/name, ' ')),
 
297
                ' -')" />
 
298
        </xsl:call-template>
 
299
    </xsl:if>
 
300
</xsl:for-each>
 
301
 
 
302
<!-- normal modules -->
 
303
<xsl:for-each select="modulefile">
 
304
<xsl:sort select="substring-before(substring-after($translist, concat('- ',
 
305
    document(concat($basedir, 'mod/', .))/modulesynopsis/name, ' ')), ' -')" />
 
306
 
 
307
    <xsl:variable name="current"
 
308
        select="document(concat($basedir, 'mod/', .))/modulesynopsis" />
 
309
 
 
310
    <xsl:if test="not($current/status='MPM') and not($current/status='Core')">
 
311
        <xsl:call-template name="toc-entry.module">
 
312
            <xsl:with-param name="current" select="$current"/>
 
313
        </xsl:call-template>
 
314
    </xsl:if>
 
315
</xsl:for-each>
 
316
</xsl:template>
 
317
<!-- /category/modulefilelist -->
 
318
 
 
319
 
 
320
<!-- ==================================================================== -->
 
321
<!-- toc-entry.mpm                                                        -->
 
322
<!-- create entry (and initiate subsection entries) of an mpm             -->
 
323
<!-- ==================================================================== -->
 
324
<xsl:template name="toc-entry.mpm">
 
325
<xsl:param name="current" />
 
326
<xsl:param name="name" />
 
327
 
 
328
&li.start;
 
329
 
 
330
<xsl:call-template name="object">
 
331
    <xsl:with-param name="name">
 
332
        <xsl:choose>
 
333
        <xsl:when test="$name='core'">
 
334
            <xsl:value-of select="normalize-space($message[@id='apachecore'])" />
 
335
        </xsl:when>
 
336
        <xsl:when test="$name='common'">
 
337
            <xsl:value-of select="normalize-space($message[@id='apachempmcommon'])" />
 
338
        </xsl:when>
 
339
        <xsl:otherwise>
 
340
            <xsl:value-of select="normalize-space($message[@id='apachempm'])" />
 
341
            <xsl:text> </xsl:text>
 
342
            <xsl:value-of select="$name" />
 
343
        </xsl:otherwise>
 
344
        </xsl:choose>
 
345
    </xsl:with-param>
 
346
    <xsl:with-param name="href"
 
347
        select="concat('mod/', $current/name, '.html')" />
 
348
    <xsl:with-param name="indent" select="'&#9;&#9;&#9;'" />
 
349
</xsl:call-template>
 
350
    
 
351
<xsl:call-template name="sections-and-directives">
 
352
    <xsl:with-param name="current" select="$current" />
 
353
</xsl:call-template>
 
354
 
 
355
&li.end; &lf;&tab;
 
356
</xsl:template>
 
357
<!-- /toc-entry.mpm -->
 
358
  
 
359
 
 
360
<!-- ==================================================================== -->
 
361
<!-- toc-entry.module                                                     -->
 
362
<!-- create entry (and initiate subsection entries) of a module           -->
 
363
<!-- ==================================================================== -->
 
364
<xsl:template name="toc-entry.module">
 
365
<xsl:param name="current"/>
 
366
 
 
367
&li.start;
 
368
 
 
369
<xsl:call-template name="object">
 
370
    <xsl:with-param name="name">
 
371
        <xsl:value-of select="normalize-space($message[@id='apachemodule'])" />
 
372
        <xsl:text> </xsl:text>
 
373
        <xsl:value-of select="$current/name" />
 
374
    </xsl:with-param>
 
375
    <xsl:with-param name="href"
 
376
        select="concat('mod/', $current/name, '.html')" />
 
377
    <xsl:with-param name="indent" select="'&#9;&#9;&#9;'" />
 
378
</xsl:call-template>
 
379
    
 
380
<xsl:call-template name="sections-and-directives">
 
381
    <xsl:with-param name="current" select="$current" />
 
382
</xsl:call-template>
 
383
 
 
384
&li.end; &lf;&tab;
 
385
</xsl:template>
 
386
<!-- /toc-entry.module -->
 
387
 
 
388
 
 
389
<!-- ==================================================================== -->
 
390
<!-- sections-and-directives                                              -->
 
391
<!-- process sections and directives of a module file                     -->
 
392
<!-- ==================================================================== -->
 
393
<xsl:template name="sections-and-directives">
 
394
<xsl:param name="current" />
 
395
 
 
396
<xsl:if test="count($current/section) &gt; 0 or
 
397
              count($current/directivesynopsis) &gt; 0">
 
398
    &lf;&tab;&tab;
 
399
 
 
400
    &ul.start; &lf;&tab;&tab;
 
401
 
 
402
    <!-- sections -->
 
403
    <xsl:for-each select="$current/section">
 
404
        &li.start;
 
405
 
 
406
        <xsl:call-template name="object">
 
407
            <xsl:with-param name="name" select="normalize-space(title)" />
 
408
            <xsl:with-param name="href">
 
409
                <xsl:if test="@id">
 
410
                    <xsl:value-of
 
411
                        select="concat('mod/', $current/name, '.html#', @id)" />
 
412
                </xsl:if>
 
413
            </xsl:with-param>
 
414
            <xsl:with-param name="indent" select="'&#9;&#9;&#9;&#9;'" />
 
415
        </xsl:call-template>
 
416
 
 
417
        &li.end; &lf;&tab;&tab;
 
418
    </xsl:for-each>
 
419
 
 
420
    <!-- directives within the current document -->
 
421
    <xsl:for-each select="$current/directivesynopsis[not(@location)]">
 
422
    <xsl:sort select="name" />
 
423
        &li.start;
 
424
 
 
425
        <xsl:call-template name="object">
 
426
            <xsl:with-param name="name">
 
427
                <xsl:if test="@type='section'">&lt;</xsl:if>
 
428
                <xsl:value-of select="name"/>
 
429
                <xsl:if test="@type='section'">&gt;</xsl:if>
 
430
                <xsl:choose>
 
431
                <xsl:when test="$message[@id='directive']
 
432
                                /@replace-space-with">
 
433
                    <xsl:value-of select="$message[@id='directive']
 
434
                                          /@replace-space-with" />
 
435
                </xsl:when>
 
436
                <xsl:otherwise>
 
437
                    <xsl:text> </xsl:text>
 
438
                </xsl:otherwise>
 
439
                </xsl:choose>
 
440
                <xsl:value-of select="normalize-space($message[@id='directive'])" />
 
441
            </xsl:with-param>
 
442
            <xsl:with-param name="href"
 
443
                select="concat('mod/', $current/name, '.html#',
 
444
                               translate(name, $uppercase, $lowercase))" />
 
445
            <xsl:with-param name="indent" select="'&#9;&#9;&#9;&#9;'" />
 
446
            <xsl:with-param name="icon" select="$icon.directive" />
 
447
        </xsl:call-template>
 
448
 
 
449
        &li.end; &lf;&tab;&tab;
 
450
    </xsl:for-each>
 
451
 
 
452
    <!-- directives described elsewhere -->
 
453
    <xsl:for-each select="$current/directivesynopsis[@location]">
 
454
    <xsl:sort select="name" />
 
455
        &li.start;
 
456
 
 
457
        <xsl:call-template name="object">
 
458
            <xsl:with-param name="name">
 
459
                <xsl:if test="@type='section'">&lt;</xsl:if>
 
460
                <xsl:value-of select="name"/>
 
461
                <xsl:if test="@type='section'">&gt;</xsl:if>
 
462
                <xsl:choose>
 
463
                <xsl:when test="$message[@id='directive']
 
464
                                /@replace-space-with">
 
465
                    <xsl:value-of select="$message[@id='directive']
 
466
                                          /@replace-space-with" />
 
467
                </xsl:when>
 
468
                <xsl:otherwise>
 
469
                    <xsl:text> </xsl:text>
 
470
                </xsl:otherwise>
 
471
                </xsl:choose>
 
472
                <xsl:value-of select="normalize-space($message[@id='directive'])" />
 
473
            </xsl:with-param>
 
474
            <xsl:with-param name="href"
 
475
                select="concat('mod/', @location, '.html#',
 
476
                               translate(name, $uppercase, $lowercase))" />
 
477
            <xsl:with-param name="indent" select="'&#9;&#9;&#9;&#9;'" />
 
478
            <xsl:with-param name="icon" select="$icon.commondirective" />
 
479
        </xsl:call-template>
 
480
 
 
481
        &li.end; &lf;&tab;&tab;
 
482
    </xsl:for-each>
 
483
 
 
484
    &ul.end; &lf;&tab;
 
485
</xsl:if> <!-- sections or directives present -->
 
486
</xsl:template>
 
487
<!-- /sections-and-directives -->
 
488
 
 
489
 
 
490
<!-- ==================================================================== -->
 
491
<!-- object                                                               -->
 
492
<!-- display an <object> and do some magic to select the right content    -->
 
493
<!-- ==================================================================== -->
 
494
<xsl:template name="object">
 
495
<xsl:param name="name" select="'? unknown ?'" />
 
496
<xsl:param name="href" />
 
497
<xsl:param name="icon" select="$icon.section" />
 
498
<xsl:param name="indent" />
 
499
 
 
500
<xsl:variable name="href.offline">
 
501
    <xsl:call-template name="helper.href.offline">
 
502
        <xsl:with-param name="href" select="$href" />
 
503
    </xsl:call-template>
 
504
</xsl:variable>
 
505
 
 
506
<!-- xml file is expected to have the same basename -->
 
507
<xsl:variable name="xml"
 
508
    select="concat(substring-before($href.offline, '.html'), '.xml')" />
 
509
 
 
510
<xsl:text>&lt;object type="text/sitemap"&gt;</xsl:text>&lf;
 
511
<xsl:value-of select="$indent" />
 
512
 
 
513
<xsl:text>&lt;param name="Name" value="</xsl:text>
 
514
    <xsl:call-template name="filter.attval">
 
515
        <xsl:with-param name="text" select="$name" />
 
516
    </xsl:call-template>
 
517
<xsl:text>"&gt;</xsl:text>&lf;
 
518
<xsl:value-of select="$indent" />
 
519
 
 
520
<xsl:if test="string-length($href.offline) &gt; 0">
 
521
    <xsl:text>&lt;param name="Local" value="</xsl:text>
 
522
        <xsl:call-template name="filter.attval">
 
523
            <xsl:with-param name="text" select="$href.offline" />
 
524
        </xsl:call-template>
 
525
    <xsl:text>"&gt;</xsl:text>&lf;
 
526
    <xsl:value-of select="$indent" />
 
527
</xsl:if>
 
528
 
 
529
<xsl:text>&lt;param name="ImageNumber" value="</xsl:text>
 
530
    <xsl:choose>
 
531
    <xsl:when test="string-length($href.offline) &gt; 0">
 
532
        <xsl:choose>
 
533
        <xsl:when test="contains($href, '#')">
 
534
            <xsl:value-of select="$icon" />
 
535
        </xsl:when>
 
536
        <xsl:when test="$doclang='en' or
 
537
                        (not($xml = $not-exists) and
 
538
                         (document(document(concat($basedir, $xml))
 
539
                                   /*/@metafile)
 
540
                          /metafile/variants/variant
 
541
                          [.=$doclang and not(@htmlonly='yes')]))">
 
542
            <xsl:value-of select="$icon.document" />
 
543
        </xsl:when>
 
544
        <xsl:otherwise>
 
545
            <xsl:value-of select="$icon.document.not-translated" />
 
546
        </xsl:otherwise>
 
547
        </xsl:choose>
 
548
    </xsl:when>
 
549
    <xsl:otherwise>
 
550
        <xsl:value-of select="$icon.no-anchor" />
 
551
    </xsl:otherwise>
 
552
    </xsl:choose>
 
553
<xsl:text>"&gt;</xsl:text>&lf;
 
554
<xsl:value-of select="substring($indent, 2)" />
 
555
 
 
556
<xsl:text>&lt;/object&gt;</xsl:text>
 
557
</xsl:template>
 
558
<!-- /object -->
 
559
 
 
560
 
 
561
<!-- ==================================================================== -->
 
562
<!-- folder                                                               -->
 
563
<!-- ==================================================================== -->
 
564
<xsl:template name="folder">
 
565
<xsl:param name="name" select="'? unknown ?'" />
 
566
 
 
567
<xsl:text>&lt;object type="text/sitemap"&gt;</xsl:text>&lf;&tab;&tab;
 
568
<xsl:text>&lt;param name="Name" value="</xsl:text>
 
569
    <xsl:call-template name="filter.attval">
 
570
        <xsl:with-param name="text" select="$name" />
 
571
    </xsl:call-template>
 
572
<xsl:text>"&gt;</xsl:text>&lf;&tab;
 
573
<xsl:text>&lt;/object&gt;</xsl:text>
 
574
</xsl:template>
 
575
<!-- /folder -->
 
576
 
 
577
 
 
578
<!-- ==================================================================== -->
 
579
<!-- helper.href.offline                                                  -->
 
580
<!-- change uri reference to work offline (/ -> /index.html)              -->
 
581
<!-- ==================================================================== -->
 
582
<xsl:template name="helper.href.offline">
 
583
<xsl:param name="href" />
 
584
 
 
585
<xsl:choose>
 
586
<xsl:when test="string-length($href) = 0" />
 
587
<xsl:when test="contains($href, '#') and '/' = substring($href,
 
588
                               string-length(substring-before($href, '#')), 1)">
 
589
    <xsl:value-of select="substring-before($href, '#')" />
 
590
    <xsl:text>index.html#</xsl:text>
 
591
    <xsl:value-of select="substring-after($href, '#')" />
 
592
</xsl:when>
 
593
<xsl:when test="substring($href, string-length($href), 1) = '/'">
 
594
    <xsl:value-of select="$href" />
 
595
    <xsl:text>index.html</xsl:text>
 
596
</xsl:when>
 
597
<xsl:otherwise>
 
598
    <xsl:value-of select="$href" />
 
599
</xsl:otherwise>
 
600
</xsl:choose>
 
601
</xsl:template>
 
602
<!-- /helper.href.offline -->
 
603
 
 
604
 
 
605
<!-- ==================================================================== -->
 
606
<!-- filter.attval                                                        -->
 
607
<!-- escape special characters for being valid within an attribute        -->
 
608
<!-- ==================================================================== -->
 
609
<xsl:template name="filter.attval">
 
610
<xsl:param name="text" />
 
611
 
 
612
<xsl:choose>
 
613
<xsl:when test="contains($text, '&amp;')">
 
614
    <xsl:call-template name="filter.attval.special">
 
615
        <xsl:with-param name="text" select="substring-before($text, '&amp;')" />
 
616
    </xsl:call-template>
 
617
    <xsl:text>&amp;amp;</xsl:text>
 
618
    <xsl:call-template name="filter.attval">
 
619
        <xsl:with-param name="text" select="substring-after($text, '&amp;')" />
 
620
    </xsl:call-template>
 
621
</xsl:when>
 
622
<xsl:otherwise>
 
623
    <xsl:call-template name="filter.attval.special">
 
624
        <xsl:with-param name="text" select="$text" />
 
625
    </xsl:call-template>
 
626
</xsl:otherwise>
 
627
</xsl:choose>
 
628
</xsl:template>
 
629
<!-- /filter.attval -->
 
630
 
 
631
 
 
632
<!-- ==================================================================== -->
 
633
<!-- filter.attval.special                                                -->
 
634
<!-- accompanying template of filter.attval                               -->
 
635
<!-- ==================================================================== -->
 
636
<xsl:template name="filter.attval.special">
 
637
<xsl:param name="text" />
 
638
 
 
639
<xsl:choose>
 
640
<xsl:when test="contains($text, '&lt;')">
 
641
    <xsl:value-of select="substring-before($text, '&lt;')" />
 
642
    <xsl:text>&amp;lt;</xsl:text>
 
643
    <xsl:call-template name="filter.attval.special">
 
644
        <xsl:with-param name="text" select="substring-after($text, '&lt;')" />
 
645
    </xsl:call-template>
 
646
</xsl:when>
 
647
<xsl:when test="contains($text, '&gt;')">
 
648
    <xsl:value-of select="substring-before($text, '&gt;')" />
 
649
    <xsl:text>&amp;gt;</xsl:text>
 
650
    <xsl:call-template name="filter.attval.special">
 
651
        <xsl:with-param name="text" select="substring-after($text, '&gt;')" />
 
652
    </xsl:call-template>
 
653
</xsl:when>
 
654
<xsl:when test="contains($text, '&quot;')">
 
655
    <xsl:value-of select="substring-before($text, '&quot;')" />
 
656
    <xsl:text>&amp;quot;</xsl:text>
 
657
    <xsl:call-template name="filter.attval.special">
 
658
        <xsl:with-param name="text" select="substring-after($text, '&quot;')" />
 
659
    </xsl:call-template>
 
660
</xsl:when>
 
661
<xsl:otherwise>
 
662
    <xsl:value-of select="$text" />
 
663
</xsl:otherwise>
 
664
</xsl:choose>
 
665
</xsl:template>
 
666
<!-- /filter.attval.special -->
 
667
 
 
668
</xsl:stylesheet>