source: stylesheets/lfs-xsl/docbook-xsl-1.78.1/xhtml-1_1/lists.xsl@ 15c7d39

10.0 10.0-rc1 10.1 10.1-rc1 11.0 11.0-rc1 11.0-rc2 11.0-rc3 11.1 11.1-rc1 11.2 11.2-rc1 11.3 11.3-rc1 12.0 12.0-rc1 12.1 12.1-rc1 12.2 12.2-rc1 7.5 7.6 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 9.0 9.1 arm bdubbs/gcc13 ml-11.0 multilib renodr/libudev-from-systemd s6-init trunk xry111/arm64 xry111/arm64-12.0 xry111/clfs-ng xry111/lfs-next xry111/loongarch xry111/loongarch-12.0 xry111/loongarch-12.1 xry111/loongarch-12.2 xry111/mips64el xry111/pip3 xry111/rust-wip-20221008 xry111/update-glibc
Last change on this file since 15c7d39 was 15c7d39, checked in by Matthew Burgess <matthew@…>, 11 years ago

Update stylesheets to docbook-xsl-1.78.1.

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@10355 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

  • Property mode set to 100644
File size: 41.0 KB
Line 
1<?xml version="1.0" encoding="ASCII"?>
2<!--This file was created automatically by html2xhtml-->
3<!--from the HTML stylesheets.-->
4<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" version="1.0">
5
6<!-- ********************************************************************
7 $Id: lists.xsl 9307 2012-04-28 03:55:07Z bobstayton $
8 ********************************************************************
9
10 This file is part of the XSL DocBook Stylesheet distribution.
11 See ../README or http://docbook.sf.net/release/xsl/current/ for
12 copyright and other information.
13
14 ******************************************************************** -->
15
16<!-- ==================================================================== -->
17
18<xsl:template match="itemizedlist">
19 <!-- Handle spacing="compact" as multiple class attribute instead
20 of the deprecated HTML compact attribute -->
21 <xsl:variable name="default.class">
22 <xsl:value-of select="local-name()"/>
23 <xsl:if test="@spacing = 'compact'">
24 <xsl:text> compact</xsl:text>
25 </xsl:if>
26 </xsl:variable>
27
28 <xsl:variable name="style.value">
29 <xsl:variable name="type">
30 <xsl:call-template name="list.itemsymbol"/>
31 </xsl:variable>
32
33 <xsl:text>list-style-type: </xsl:text>
34 <xsl:value-of select="$type"/>
35 <xsl:text>; </xsl:text>
36 </xsl:variable>
37
38 <div>
39 <xsl:call-template name="common.html.attributes"/>
40 <xsl:call-template name="id.attribute"/>
41 <xsl:call-template name="anchor"/>
42 <xsl:if test="title|info/title">
43 <xsl:call-template name="formal.object.heading"/>
44 </xsl:if>
45
46 <!-- Preserve order of PIs and comments -->
47 <xsl:apply-templates select="*[not(self::listitem or self::title or self::titleabbrev)] |comment()[not(preceding-sibling::listitem)] |processing-instruction()[not(preceding-sibling::listitem)]"/>
48
49 <ul>
50 <xsl:call-template name="generate.class.attribute">
51 <xsl:with-param name="class" select="$default.class"/>
52 </xsl:call-template>
53 <xsl:choose>
54 <xsl:when test="$css.decoration != 0">
55 <xsl:attribute name="style">
56 <xsl:value-of select="$style.value"/>
57 </xsl:attribute>
58 </xsl:when>
59 <xsl:when test="$make.clean.html != 0">
60 <!-- styled by separate css only -->
61 </xsl:when>
62 <xsl:otherwise>
63 <!-- use the old @type attribute -->
64
65 </xsl:otherwise>
66 </xsl:choose>
67
68 <xsl:apply-templates select="listitem |comment()[preceding-sibling::listitem] |processing-instruction()[preceding-sibling::listitem]"/>
69 </ul>
70 </div>
71</xsl:template>
72
73<xsl:template match="itemizedlist/title">
74 <!-- nop -->
75</xsl:template>
76
77<xsl:template match="itemizedlist/listitem">
78 <xsl:variable name="mark" select="../@mark"/>
79 <xsl:variable name="override" select="@override"/>
80
81 <xsl:variable name="usemark">
82 <xsl:choose>
83 <xsl:when test="$override != ''">
84 <xsl:value-of select="$override"/>
85 </xsl:when>
86 <xsl:otherwise>
87 <xsl:value-of select="$mark"/>
88 </xsl:otherwise>
89 </xsl:choose>
90 </xsl:variable>
91
92 <xsl:variable name="cssmark">
93 <xsl:choose>
94 <xsl:when test="$usemark = 'opencircle'">circle</xsl:when>
95 <xsl:when test="$usemark = 'bullet'">disc</xsl:when>
96 <xsl:when test="$usemark = 'box'">square</xsl:when>
97 <xsl:otherwise>
98 <xsl:value-of select="$usemark"/>
99 </xsl:otherwise>
100 </xsl:choose>
101 </xsl:variable>
102
103 <li>
104 <xsl:call-template name="common.html.attributes"/>
105 <xsl:call-template name="id.attribute"/>
106 <xsl:if test="$css.decoration = '1' and $cssmark != ''">
107 <xsl:attribute name="style">
108 <xsl:text>list-style-type: </xsl:text>
109 <xsl:value-of select="$cssmark"/>
110 </xsl:attribute>
111 </xsl:if>
112
113 <!-- we can't just drop the anchor in since some browsers (Opera)
114 get confused about line breaks if we do. So if the first child
115 is a para, assume the para will put in the anchor. Otherwise,
116 put the anchor in anyway. -->
117 <xsl:if test="local-name(child::*[1]) != 'para'">
118 <xsl:call-template name="anchor"/>
119 </xsl:if>
120
121 <xsl:choose>
122 <xsl:when test="$show.revisionflag != 0 and @revisionflag">
123 <div class="{@revisionflag}">
124 <xsl:apply-templates/>
125 </div>
126 </xsl:when>
127 <xsl:otherwise>
128 <xsl:apply-templates/>
129 </xsl:otherwise>
130 </xsl:choose>
131 </li>
132</xsl:template>
133
134<xsl:template match="orderedlist">
135 <!-- Handle spacing="compact" as multiple class attribute instead
136 of the deprecated HTML compact attribute -->
137 <xsl:variable name="default.class">
138 <xsl:value-of select="local-name()"/>
139 <xsl:if test="@spacing = 'compact'">
140 <xsl:text> compact</xsl:text>
141 </xsl:if>
142 </xsl:variable>
143
144 <xsl:variable name="start">
145 <xsl:call-template name="orderedlist-starting-number"/>
146 </xsl:variable>
147
148 <xsl:variable name="numeration">
149 <xsl:call-template name="list.numeration"/>
150 </xsl:variable>
151
152 <xsl:variable name="type">
153 <xsl:choose>
154 <xsl:when test="$numeration='arabic'">1</xsl:when>
155 <xsl:when test="$numeration='loweralpha'">a</xsl:when>
156 <xsl:when test="$numeration='lowerroman'">i</xsl:when>
157 <xsl:when test="$numeration='upperalpha'">A</xsl:when>
158 <xsl:when test="$numeration='upperroman'">I</xsl:when>
159 <!-- What!? This should never happen -->
160 <xsl:otherwise>
161 <xsl:message>
162 <xsl:text>Unexpected numeration: </xsl:text>
163 <xsl:value-of select="$numeration"/>
164 </xsl:message>
165 <xsl:value-of select="1"/>
166 </xsl:otherwise>
167 </xsl:choose>
168 </xsl:variable>
169
170 <div>
171 <xsl:call-template name="common.html.attributes"/>
172 <xsl:call-template name="id.attribute"/>
173 <xsl:call-template name="anchor"/>
174
175 <xsl:if test="title|info/title">
176 <xsl:call-template name="formal.object.heading"/>
177 </xsl:if>
178
179 <!-- Preserve order of PIs and comments -->
180 <xsl:apply-templates select="*[not(self::listitem or self::title or self::titleabbrev)] |comment()[not(preceding-sibling::listitem)] |processing-instruction()[not(preceding-sibling::listitem)]"/>
181
182 <xsl:choose>
183 <xsl:when test="@inheritnum='inherit' and ancestor::listitem[parent::orderedlist]">
184 <table border="{$table.border.off}">
185 <xsl:call-template name="generate.class.attribute">
186 <xsl:with-param name="class" select="$default.class"/>
187 </xsl:call-template>
188 <colgroup>
189 <col align="{$direction.align.start}" valign="top"/>
190 <col/>
191 </colgroup>
192 <tbody>
193 <xsl:apply-templates mode="orderedlist-table" select="listitem |comment()[preceding-sibling::listitem] |processing-instruction()[preceding-sibling::listitem]"/>
194 </tbody>
195 </table>
196 </xsl:when>
197 <xsl:otherwise>
198 <ol>
199 <xsl:call-template name="generate.class.attribute">
200 <xsl:with-param name="class" select="$default.class"/>
201 </xsl:call-template>
202 <xsl:if test="$start != '1'"><xsl:message><xsl:text>Strict XHTML does not allow setting @start attribute for lists! </xsl:text></xsl:message></xsl:if>
203 <xsl:if test="$numeration != ''">
204
205 </xsl:if>
206 <xsl:apply-templates select="listitem |comment()[preceding-sibling::listitem] |processing-instruction()[preceding-sibling::listitem]"/>
207 </ol>
208 </xsl:otherwise>
209 </xsl:choose>
210 </div>
211</xsl:template>
212
213<xsl:template match="orderedlist/title">
214 <!-- nop -->
215</xsl:template>
216
217<xsl:template match="orderedlist/listitem">
218 <li>
219 <xsl:call-template name="common.html.attributes"/>
220 <xsl:call-template name="id.attribute"/>
221 <xsl:if test="@override"><xsl:message><xsl:text>@override attribute cannot be set in strict XHTML output for listitem: </xsl:text><xsl:value-of select="@override"/></xsl:message></xsl:if>
222
223 <!-- we can't just drop the anchor in since some browsers (Opera)
224 get confused about line breaks if we do. So if the first child
225 is a para, assume the para will put in the anchor. Otherwise,
226 put the anchor in anyway. -->
227 <xsl:if test="local-name(child::*[1]) != 'para'">
228 <xsl:call-template name="anchor"/>
229 </xsl:if>
230
231 <xsl:choose>
232 <xsl:when test="$show.revisionflag != 0 and @revisionflag">
233 <div class="{@revisionflag}">
234 <xsl:apply-templates/>
235 </div>
236 </xsl:when>
237 <xsl:otherwise>
238 <xsl:apply-templates/>
239 </xsl:otherwise>
240 </xsl:choose>
241 </li>
242</xsl:template>
243
244<xsl:template match="orderedlist/listitem" mode="orderedlist-table">
245 <tr>
246 <td>
247 <xsl:apply-templates select="." mode="item-number"/>
248 </td>
249 <td>
250 <xsl:if test="local-name(child::*[1]) != 'para'">
251 <xsl:call-template name="id.attribute"/>
252 <xsl:call-template name="anchor"/>
253 </xsl:if>
254
255 <xsl:choose>
256 <xsl:when test="$show.revisionflag != 0 and @revisionflag">
257 <div class="{@revisionflag}">
258 <xsl:apply-templates/>
259 </div>
260 </xsl:when>
261 <xsl:otherwise>
262 <xsl:apply-templates/>
263 </xsl:otherwise>
264 </xsl:choose>
265 </td>
266 </tr>
267</xsl:template>
268
269<xsl:template match="variablelist">
270 <xsl:variable name="pi-presentation">
271 <xsl:call-template name="pi.dbhtml_list-presentation"/>
272 </xsl:variable>
273 <!-- Handle spacing="compact" as multiple class attribute instead
274 of the deprecated HTML compact attribute -->
275 <xsl:variable name="default.class">
276 <xsl:value-of select="local-name()"/>
277 <xsl:if test="@spacing = 'compact'">
278 <xsl:text> compact</xsl:text>
279 </xsl:if>
280 </xsl:variable>
281
282
283 <xsl:variable name="presentation">
284 <xsl:choose>
285 <xsl:when test="$pi-presentation != ''">
286 <xsl:value-of select="$pi-presentation"/>
287 </xsl:when>
288 <xsl:when test="$variablelist.as.table != 0">
289 <xsl:value-of select="'table'"/>
290 </xsl:when>
291 <xsl:otherwise>
292 <xsl:value-of select="'list'"/>
293 </xsl:otherwise>
294 </xsl:choose>
295 </xsl:variable>
296
297 <xsl:variable name="list-width">
298 <xsl:call-template name="pi.dbhtml_list-width"/>
299 </xsl:variable>
300
301 <xsl:variable name="term-width">
302 <xsl:call-template name="pi.dbhtml_term-width"/>
303 </xsl:variable>
304
305 <xsl:variable name="table-summary">
306 <xsl:call-template name="pi.dbhtml_table-summary"/>
307 </xsl:variable>
308
309 <div>
310 <xsl:call-template name="common.html.attributes"/>
311 <xsl:call-template name="id.attribute"/>
312 <xsl:call-template name="anchor"/>
313 <xsl:if test="title|info/title">
314 <xsl:call-template name="formal.object.heading"/>
315 </xsl:if>
316
317 <xsl:choose>
318 <xsl:when test="$presentation = 'table'">
319 <!-- Preserve order of PIs and comments -->
320 <xsl:apply-templates select="*[not(self::varlistentry or self::title or self::titleabbrev)] |comment()[not(preceding-sibling::varlistentry)] |processing-instruction()[not(preceding-sibling::varlistentry)]"/>
321 <table border="{$table.border.off}">
322 <xsl:call-template name="generate.class.attribute">
323 <xsl:with-param name="class" select="$default.class"/>
324 </xsl:call-template>
325 <xsl:if test="$list-width != ''">
326 <xsl:attribute name="width">
327 <xsl:value-of select="$list-width"/>
328 </xsl:attribute>
329 </xsl:if>
330 <xsl:if test="$table-summary != ''">
331 <xsl:attribute name="summary">
332 <xsl:value-of select="$table-summary"/>
333 </xsl:attribute>
334 </xsl:if>
335 <colgroup>
336 <col align="{$direction.align.start}" valign="top">
337 <xsl:if test="$term-width != ''">
338 <xsl:attribute name="width">
339 <xsl:value-of select="$term-width"/>
340 </xsl:attribute>
341 </xsl:if>
342 </col>
343 <col/>
344 </colgroup>
345 <tbody>
346 <xsl:apply-templates mode="varlist-table" select="varlistentry |comment()[preceding-sibling::varlistentry] |processing-instruction()[preceding-sibling::varlistentry]"/>
347 </tbody>
348 </table>
349 </xsl:when>
350 <xsl:otherwise>
351 <!-- Preserve order of PIs and comments -->
352 <xsl:apply-templates select="*[not(self::varlistentry or self::title or self::titleabbrev)] |comment()[not(preceding-sibling::varlistentry)] |processing-instruction()[not(preceding-sibling::varlistentry)]"/>
353 <dl>
354 <xsl:call-template name="generate.class.attribute">
355 <xsl:with-param name="class" select="$default.class"/>
356 </xsl:call-template>
357 <xsl:apply-templates select="varlistentry |comment()[preceding-sibling::varlistentry] |processing-instruction()[preceding-sibling::varlistentry]"/>
358 </dl>
359 </xsl:otherwise>
360 </xsl:choose>
361 </div>
362</xsl:template>
363
364<xsl:template match="variablelist/title">
365 <!-- nop -->
366</xsl:template>
367
368<xsl:template match="itemizedlist/titleabbrev|orderedlist/titleabbrev">
369 <!--nop-->
370</xsl:template>
371
372<xsl:template match="variablelist/titleabbrev">
373 <!--nop-->
374</xsl:template>
375
376<xsl:template match="listitem" mode="xref">
377 <xsl:number format="1"/>
378</xsl:template>
379
380<xsl:template match="listitem/simpara" priority="2">
381 <!-- If a listitem contains only a single simpara, don't output
382 the <p> wrapper; this has the effect of creating an li
383 with simple text content. -->
384 <xsl:choose>
385 <xsl:when test="not(preceding-sibling::*) and not (following-sibling::*)">
386 <xsl:call-template name="anchor"/>
387 <xsl:apply-templates/>
388 </xsl:when>
389 <xsl:otherwise>
390 <p>
391 <xsl:call-template name="id.attribute"/>
392 <xsl:choose>
393 <xsl:when test="@role and $para.propagates.style != 0">
394 <xsl:call-template name="common.html.attributes">
395 <xsl:with-param name="class" select="@role"/>
396 </xsl:call-template>
397 </xsl:when>
398 <xsl:otherwise>
399 <xsl:call-template name="common.html.attributes"/>
400 </xsl:otherwise>
401 </xsl:choose>
402
403 <xsl:call-template name="anchor"/>
404 <xsl:apply-templates/>
405 </p>
406 </xsl:otherwise>
407 </xsl:choose>
408</xsl:template>
409
410<xsl:template match="varlistentry">
411 <dt>
412 <xsl:call-template name="id.attribute"/>
413 <xsl:call-template name="anchor"/>
414 <xsl:apply-templates select="term"/>
415 </dt>
416 <dd>
417 <xsl:apply-templates select="listitem"/>
418 </dd>
419</xsl:template>
420
421<xsl:template match="varlistentry" mode="varlist-table">
422 <xsl:variable name="presentation">
423 <xsl:call-template name="pi.dbhtml_term-presentation">
424 <xsl:with-param name="node" select=".."/>
425 </xsl:call-template>
426 </xsl:variable>
427
428 <xsl:variable name="separator">
429 <xsl:call-template name="pi.dbhtml_term-separator">
430 <xsl:with-param name="node" select=".."/>
431 </xsl:call-template>
432 </xsl:variable>
433 <tr>
434 <xsl:call-template name="tr.attributes">
435 <xsl:with-param name="rownum">
436 <xsl:number from="variablelist" count="varlistentry"/>
437 </xsl:with-param>
438 </xsl:call-template>
439
440 <td>
441 <xsl:call-template name="id.attribute"/>
442 <p>
443 <xsl:call-template name="anchor"/>
444 <xsl:choose>
445 <xsl:when test="$presentation = 'bold'">
446 <strong>
447 <xsl:apply-templates select="term"/>
448 <xsl:value-of select="$separator"/>
449 </strong>
450 </xsl:when>
451 <xsl:when test="$presentation = 'italic'">
452 <em>
453 <xsl:apply-templates select="term"/>
454 <xsl:value-of select="$separator"/>
455 </em>
456 </xsl:when>
457 <xsl:when test="$presentation = 'bold-italic'">
458 <strong>
459 <em>
460 <xsl:apply-templates select="term"/>
461 <xsl:value-of select="$separator"/>
462 </em>
463 </strong>
464 </xsl:when>
465 <xsl:otherwise>
466 <xsl:apply-templates select="term"/>
467 <xsl:value-of select="$separator"/>
468 </xsl:otherwise>
469 </xsl:choose>
470 </p>
471 </td>
472 <td>
473 <xsl:apply-templates select="listitem"/>
474 </td>
475 </tr>
476</xsl:template>
477
478<xsl:template match="varlistentry/term">
479 <span>
480 <xsl:call-template name="common.html.attributes"/>
481 <xsl:call-template name="id.attribute"/>
482 <xsl:call-template name="anchor"/>
483 <xsl:call-template name="simple.xlink">
484 <xsl:with-param name="content">
485 <xsl:apply-templates/>
486 </xsl:with-param>
487 </xsl:call-template>
488 <xsl:choose>
489 <xsl:when test="position() = last()"/> <!-- do nothing -->
490 <xsl:otherwise>
491 <!-- * if we have multiple terms in the same varlistentry, generate -->
492 <!-- * a separator (", " by default) and/or an additional line -->
493 <!-- * break after each one except the last -->
494 <xsl:value-of select="$variablelist.term.separator"/>
495 <xsl:if test="not($variablelist.term.break.after = '0')">
496 <br/>
497 </xsl:if>
498 </xsl:otherwise>
499 </xsl:choose>
500 </span>
501</xsl:template>
502
503<xsl:template match="varlistentry/listitem">
504 <!-- we can't just drop the anchor in since some browsers (Opera)
505 get confused about line breaks if we do. So if the first child
506 is a para, assume the para will put in the anchor. Otherwise,
507 put the anchor in anyway. -->
508 <xsl:if test="local-name(child::*[1]) != 'para'">
509 <xsl:call-template name="anchor"/>
510 </xsl:if>
511
512 <xsl:choose>
513 <xsl:when test="$show.revisionflag != 0 and @revisionflag">
514 <div class="{@revisionflag}">
515 <xsl:apply-templates/>
516 </div>
517 </xsl:when>
518 <xsl:otherwise>
519 <xsl:apply-templates/>
520 </xsl:otherwise>
521 </xsl:choose>
522</xsl:template>
523
524<!-- ==================================================================== -->
525
526<xsl:template match="simplelist">
527 <!-- with no type specified, the default is 'vert' -->
528 <xsl:call-template name="anchor"/>
529 <table border="{$table.border.off}">
530 <xsl:if test="$div.element != 'section'">
531 <xsl:attribute name="summary">Simple list</xsl:attribute>
532 </xsl:if>
533 <xsl:call-template name="common.html.attributes"/>
534 <xsl:call-template name="id.attribute"/>
535 <xsl:call-template name="simplelist.vert">
536 <xsl:with-param name="cols">
537 <xsl:choose>
538 <xsl:when test="@columns">
539 <xsl:value-of select="@columns"/>
540 </xsl:when>
541 <xsl:otherwise>1</xsl:otherwise>
542 </xsl:choose>
543 </xsl:with-param>
544 </xsl:call-template>
545 </table>
546</xsl:template>
547
548<xsl:template match="simplelist[@type='inline']">
549 <span>
550 <xsl:call-template name="common.html.attributes"/>
551 <xsl:call-template name="id.attribute"/>
552 <!-- if dbchoice PI exists, use that to determine the choice separator -->
553 <!-- (that is, equivalent of "and" or "or" in current locale), or literal -->
554 <!-- value of "choice" otherwise -->
555 <xsl:variable name="localized-choice-separator">
556 <xsl:choose>
557 <xsl:when test="processing-instruction('dbchoice')">
558 <xsl:call-template name="select.choice.separator"/>
559 </xsl:when>
560 <xsl:otherwise>
561 <!-- empty -->
562 </xsl:otherwise>
563 </xsl:choose>
564 </xsl:variable>
565
566 <xsl:for-each select="member">
567 <xsl:call-template name="simple.xlink">
568 <xsl:with-param name="content">
569 <xsl:apply-templates/>
570 </xsl:with-param>
571 </xsl:call-template>
572 <xsl:choose>
573 <xsl:when test="position() = last()"/> <!-- do nothing -->
574 <xsl:otherwise>
575 <xsl:text>, </xsl:text>
576 <xsl:if test="position() = last() - 1">
577 <xsl:if test="$localized-choice-separator != ''">
578 <xsl:value-of select="$localized-choice-separator"/>
579 <xsl:text> </xsl:text>
580 </xsl:if>
581 </xsl:if>
582 </xsl:otherwise>
583 </xsl:choose>
584 </xsl:for-each>
585 </span>
586</xsl:template>
587
588<xsl:template match="simplelist[@type='horiz']">
589 <xsl:call-template name="anchor"/>
590 <table border="{$table.border.off}">
591 <xsl:if test="$div.element != 'section'">
592 <xsl:attribute name="summary">Simple list</xsl:attribute>
593 </xsl:if>
594 <xsl:call-template name="common.html.attributes"/>
595 <xsl:call-template name="id.attribute"/>
596 <xsl:call-template name="simplelist.horiz">
597 <xsl:with-param name="cols">
598 <xsl:choose>
599 <xsl:when test="@columns">
600 <xsl:value-of select="@columns"/>
601 </xsl:when>
602 <xsl:otherwise>1</xsl:otherwise>
603 </xsl:choose>
604 </xsl:with-param>
605 </xsl:call-template>
606 </table>
607</xsl:template>
608
609<xsl:template match="simplelist[@type='vert']">
610 <xsl:call-template name="anchor"/>
611 <table border="{$table.border.off}">
612 <xsl:if test="$div.element != 'section'">
613 <xsl:attribute name="summary">Simple list</xsl:attribute>
614 </xsl:if>
615 <xsl:call-template name="common.html.attributes"/>
616 <xsl:call-template name="id.attribute"/>
617 <xsl:call-template name="simplelist.vert">
618 <xsl:with-param name="cols">
619 <xsl:choose>
620 <xsl:when test="@columns">
621 <xsl:value-of select="@columns"/>
622 </xsl:when>
623 <xsl:otherwise>1</xsl:otherwise>
624 </xsl:choose>
625 </xsl:with-param>
626 </xsl:call-template>
627 </table>
628</xsl:template>
629
630<xsl:template name="simplelist.horiz">
631 <xsl:param name="cols">1</xsl:param>
632 <xsl:param name="cell">1</xsl:param>
633 <xsl:param name="members" select="./member"/>
634
635 <xsl:if test="$cell &lt;= count($members)">
636 <tr>
637 <xsl:call-template name="tr.attributes">
638 <xsl:with-param name="row" select="$members[1]"/>
639 <xsl:with-param name="rownum" select="(($cell - 1) div $cols) + 1"/>
640 </xsl:call-template>
641
642 <xsl:call-template name="simplelist.horiz.row">
643 <xsl:with-param name="cols" select="$cols"/>
644 <xsl:with-param name="cell" select="$cell"/>
645 <xsl:with-param name="members" select="$members"/>
646 </xsl:call-template>
647 </tr>
648 <xsl:call-template name="simplelist.horiz">
649 <xsl:with-param name="cols" select="$cols"/>
650 <xsl:with-param name="cell" select="$cell + $cols"/>
651 <xsl:with-param name="members" select="$members"/>
652 </xsl:call-template>
653 </xsl:if>
654</xsl:template>
655
656<xsl:template name="simplelist.horiz.row">
657 <xsl:param name="cols">1</xsl:param>
658 <xsl:param name="cell">1</xsl:param>
659 <xsl:param name="members" select="./member"/>
660 <xsl:param name="curcol">1</xsl:param>
661
662 <xsl:if test="$curcol &lt;= $cols">
663 <td>
664 <xsl:choose>
665 <xsl:when test="$members[position()=$cell]">
666 <xsl:apply-templates select="$members[position()=$cell]"/>
667 </xsl:when>
668 <xsl:otherwise>
669 <xsl:text>&#160;</xsl:text>
670 </xsl:otherwise>
671 </xsl:choose>
672 </td>
673 <xsl:call-template name="simplelist.horiz.row">
674 <xsl:with-param name="cols" select="$cols"/>
675 <xsl:with-param name="cell" select="$cell+1"/>
676 <xsl:with-param name="members" select="$members"/>
677 <xsl:with-param name="curcol" select="$curcol+1"/>
678 </xsl:call-template>
679 </xsl:if>
680</xsl:template>
681
682<xsl:template name="simplelist.vert">
683 <xsl:param name="cols">1</xsl:param>
684 <xsl:param name="cell">1</xsl:param>
685 <xsl:param name="members" select="./member"/>
686 <xsl:param name="rows" select="floor((count($members)+$cols - 1) div $cols)"/>
687
688 <xsl:if test="$cell &lt;= $rows">
689 <tr>
690 <xsl:call-template name="tr.attributes">
691 <xsl:with-param name="row" select="$members[1]"/>
692 <xsl:with-param name="rownum" select="$cell"/>
693 </xsl:call-template>
694
695 <xsl:call-template name="simplelist.vert.row">
696 <xsl:with-param name="cols" select="$cols"/>
697 <xsl:with-param name="rows" select="$rows"/>
698 <xsl:with-param name="cell" select="$cell"/>
699 <xsl:with-param name="members" select="$members"/>
700 </xsl:call-template>
701 </tr>
702 <xsl:call-template name="simplelist.vert">
703 <xsl:with-param name="cols" select="$cols"/>
704 <xsl:with-param name="cell" select="$cell+1"/>
705 <xsl:with-param name="members" select="$members"/>
706 <xsl:with-param name="rows" select="$rows"/>
707 </xsl:call-template>
708 </xsl:if>
709</xsl:template>
710
711<xsl:template name="simplelist.vert.row">
712 <xsl:param name="cols">1</xsl:param>
713 <xsl:param name="rows">1</xsl:param>
714 <xsl:param name="cell">1</xsl:param>
715 <xsl:param name="members" select="./member"/>
716 <xsl:param name="curcol">1</xsl:param>
717
718 <xsl:if test="$curcol &lt;= $cols">
719 <td>
720 <xsl:choose>
721 <xsl:when test="$members[position()=$cell]">
722 <xsl:apply-templates select="$members[position()=$cell]"/>
723 </xsl:when>
724 <xsl:otherwise>
725 <xsl:text>&#160;</xsl:text>
726 </xsl:otherwise>
727 </xsl:choose>
728 </td>
729 <xsl:call-template name="simplelist.vert.row">
730 <xsl:with-param name="cols" select="$cols"/>
731 <xsl:with-param name="rows" select="$rows"/>
732 <xsl:with-param name="cell" select="$cell+$rows"/>
733 <xsl:with-param name="members" select="$members"/>
734 <xsl:with-param name="curcol" select="$curcol+1"/>
735 </xsl:call-template>
736 </xsl:if>
737</xsl:template>
738
739<xsl:template match="member">
740 <xsl:call-template name="anchor"/>
741 <xsl:call-template name="simple.xlink">
742 <xsl:with-param name="content">
743 <xsl:apply-templates/>
744 </xsl:with-param>
745 </xsl:call-template>
746</xsl:template>
747
748<!-- ==================================================================== -->
749
750<xsl:template match="procedure">
751 <xsl:variable name="param.placement" select="substring-after(normalize-space($formal.title.placement), concat(local-name(.), ' '))"/>
752
753 <xsl:variable name="placement">
754 <xsl:choose>
755 <xsl:when test="contains($param.placement, ' ')">
756 <xsl:value-of select="substring-before($param.placement, ' ')"/>
757 </xsl:when>
758 <xsl:when test="$param.placement = ''">before</xsl:when>
759 <xsl:otherwise>
760 <xsl:value-of select="$param.placement"/>
761 </xsl:otherwise>
762 </xsl:choose>
763 </xsl:variable>
764
765 <!-- Preserve order of PIs and comments -->
766 <xsl:variable name="preamble" select="*[not(self::step or self::title or self::titleabbrev)] |comment()[not(preceding-sibling::step)] |processing-instruction()[not(preceding-sibling::step)]"/>
767
768 <div>
769 <xsl:call-template name="common.html.attributes"/>
770 <xsl:call-template name="id.attribute">
771 <xsl:with-param name="conditional">
772 <xsl:choose>
773 <xsl:when test="title">0</xsl:when>
774 <xsl:otherwise>1</xsl:otherwise>
775 </xsl:choose>
776 </xsl:with-param>
777 </xsl:call-template>
778 <xsl:call-template name="anchor">
779 <xsl:with-param name="conditional">
780 <xsl:choose>
781 <xsl:when test="title">0</xsl:when>
782 <xsl:otherwise>1</xsl:otherwise>
783 </xsl:choose>
784 </xsl:with-param>
785 </xsl:call-template>
786
787 <xsl:if test="(title or info/title) and $placement = 'before'">
788 <xsl:call-template name="formal.object.heading"/>
789 </xsl:if>
790
791 <xsl:apply-templates select="$preamble"/>
792
793 <xsl:choose>
794 <xsl:when test="count(step) = 1">
795 <ul>
796 <xsl:call-template name="generate.class.attribute"/>
797 <xsl:apply-templates select="step |comment()[preceding-sibling::step] |processing-instruction()[preceding-sibling::step]"/>
798 </ul>
799 </xsl:when>
800 <xsl:otherwise>
801 <ol>
802 <xsl:call-template name="generate.class.attribute"/>
803
804 <xsl:apply-templates select="step |comment()[preceding-sibling::step] |processing-instruction()[preceding-sibling::step]"/>
805 </ol>
806 </xsl:otherwise>
807 </xsl:choose>
808
809 <xsl:if test="(title or info/title) and $placement != 'before'">
810 <xsl:call-template name="formal.object.heading"/>
811 </xsl:if>
812 </div>
813</xsl:template>
814
815<xsl:template match="procedure/title">
816 <!-- nop -->
817</xsl:template>
818
819<xsl:template match="substeps"><xsl:variable name="numeration"><xsl:call-template name="procedure.step.numeration"/></xsl:variable><xsl:variable name="cssstyle"><xsl:choose><xsl:when test="$numeration = '1'">decimal</xsl:when><xsl:when test="$numeration = 'a'">lower-alpha</xsl:when><xsl:when test="$numeration = 'i'">lower-roman</xsl:when><xsl:when test="$numeration = 'A'">upper-alpha</xsl:when><xsl:when test="$numeration = 'I'">upper-roman</xsl:when><xsl:otherwise><xsl:message>Warning: unknown procedure.step.numeration value: <xsl:value-of select="$numeration"/></xsl:message></xsl:otherwise></xsl:choose></xsl:variable><xsl:call-template name="anchor"/><ol><xsl:attribute name="style"><xsl:text>list-style-type: </xsl:text><xsl:value-of select="$cssstyle"/></xsl:attribute><xsl:apply-templates/></ol></xsl:template>
820
821<xsl:template match="step">
822 <li>
823 <xsl:call-template name="common.html.attributes"/>
824 <xsl:call-template name="id.attribute"/>
825 <xsl:call-template name="anchor"/>
826 <xsl:apply-templates/>
827 </li>
828</xsl:template>
829
830<xsl:template match="stepalternatives">
831 <xsl:call-template name="anchor"/>
832 <ul>
833 <xsl:call-template name="common.html.attributes"/>
834 <xsl:call-template name="id.attribute"/>
835 <xsl:apply-templates/>
836 </ul>
837</xsl:template>
838
839<xsl:template match="step/title">
840 <p>
841 <xsl:call-template name="common.html.attributes"/>
842 <strong xmlns:xslo="http://www.w3.org/1999/XSL/Transform">
843 <xsl:apply-templates/>
844 </strong>
845 </p>
846</xsl:template>
847
848<!-- ==================================================================== -->
849
850<xsl:template match="segmentedlist">
851 <xsl:variable name="presentation">
852 <xsl:call-template name="pi.dbhtml_list-presentation"/>
853 </xsl:variable>
854
855 <div>
856 <xsl:call-template name="common.html.attributes"/>
857 <xsl:call-template name="id.attribute"/>
858 <xsl:call-template name="anchor"/>
859
860 <xsl:choose>
861 <xsl:when test="$presentation = 'table'">
862 <xsl:apply-templates select="." mode="seglist-table"/>
863 </xsl:when>
864 <xsl:when test="$presentation = 'list'">
865 <xsl:apply-templates/>
866 </xsl:when>
867 <xsl:when test="$segmentedlist.as.table != 0">
868 <xsl:apply-templates select="." mode="seglist-table"/>
869 </xsl:when>
870 <xsl:otherwise>
871 <xsl:apply-templates/>
872 </xsl:otherwise>
873 </xsl:choose>
874 </div>
875</xsl:template>
876
877<xsl:template match="segmentedlist/title">
878 <div>
879 <xsl:call-template name="common.html.attributes"/>
880 <strong>
881 <span>
882 <xsl:call-template name="generate.class.attribute"/>
883 <xsl:apply-templates/>
884 </span>
885 </strong>
886 </div>
887</xsl:template>
888
889<xsl:template match="segtitle">
890</xsl:template>
891
892<xsl:template match="segtitle" mode="segtitle-in-seg">
893 <xsl:apply-templates/>
894</xsl:template>
895
896<xsl:template match="seglistitem">
897 <div>
898 <xsl:call-template name="common.html.attributes"/>
899 <xsl:call-template name="id.attribute"/>
900 <xsl:call-template name="anchor"/>
901 <xsl:apply-templates/>
902 </div>
903</xsl:template>
904
905<xsl:template match="seg">
906 <xsl:variable name="segnum" select="count(preceding-sibling::seg)+1"/>
907 <xsl:variable name="seglist" select="ancestor::segmentedlist"/>
908 <xsl:variable name="segtitles" select="$seglist/segtitle"/>
909
910 <!--
911 Note: segtitle is only going to be the right thing in a well formed
912 SegmentedList. If there are too many Segs or too few SegTitles,
913 you'll get something odd...maybe an error
914 -->
915
916 <div>
917 <xsl:call-template name="common.html.attributes"/>
918 <xsl:call-template name="id.attribute"/>
919 <strong>
920 <span class="segtitle">
921 <xsl:apply-templates select="$segtitles[$segnum=position()]" mode="segtitle-in-seg"/>
922 <xsl:text>: </xsl:text>
923 </span>
924 </strong>
925 <xsl:apply-templates/>
926 </div>
927</xsl:template>
928
929<xsl:template match="segmentedlist" mode="seglist-table">
930 <xsl:variable name="table-summary">
931 <xsl:call-template name="pi.dbhtml_table-summary"/>
932 </xsl:variable>
933
934 <xsl:variable name="list-width">
935 <xsl:call-template name="pi.dbhtml_list-width"/>
936 </xsl:variable>
937
938 <xsl:apply-templates select="title"/>
939
940 <table border="{$table.border.off}">
941 <xsl:if test="$list-width != ''">
942 <xsl:attribute name="width">
943 <xsl:value-of select="$list-width"/>
944 </xsl:attribute>
945 </xsl:if>
946 <xsl:if test="$table-summary != '' and $div.element != 'section'">
947 <xsl:attribute name="summary">
948 <xsl:value-of select="$table-summary"/>
949 </xsl:attribute>
950 </xsl:if>
951 <thead>
952 <tr class="segtitle">
953 <xsl:call-template name="tr.attributes">
954 <xsl:with-param name="row" select="segtitle[1]"/>
955 <xsl:with-param name="rownum" select="1"/>
956 </xsl:call-template>
957 <xsl:apply-templates select="segtitle" mode="seglist-table"/>
958 </tr>
959 </thead>
960 <tbody>
961 <xsl:apply-templates select="seglistitem" mode="seglist-table"/>
962 </tbody>
963 </table>
964</xsl:template>
965
966<xsl:template match="segtitle" mode="seglist-table">
967 <th><xsl:apply-templates/></th>
968</xsl:template>
969
970<xsl:template match="seglistitem" mode="seglist-table">
971 <xsl:variable name="seglinum">
972 <xsl:number from="segmentedlist" count="seglistitem"/>
973 </xsl:variable>
974
975 <tr>
976 <xsl:call-template name="common.html.attributes"/>
977 <xsl:call-template name="id.attribute"/>
978 <xsl:call-template name="tr.attributes">
979 <xsl:with-param name="rownum" select="$seglinum + 1"/>
980 </xsl:call-template>
981 <xsl:apply-templates mode="seglist-table"/>
982 </tr>
983</xsl:template>
984
985<xsl:template match="seg" mode="seglist-table">
986 <td>
987 <xsl:call-template name="common.html.attributes"/>
988 <xsl:call-template name="id.attribute"/>
989 <xsl:apply-templates/>
990 </td>
991</xsl:template>
992
993<xsl:template match="seg[1]" mode="seglist-table">
994 <td>
995 <xsl:call-template name="common.html.attributes"/>
996 <xsl:call-template name="id.attribute"/>
997 <xsl:call-template name="anchor">
998 <xsl:with-param name="node" select="ancestor::seglistitem"/>
999 </xsl:call-template>
1000 <xsl:apply-templates/>
1001 </td>
1002</xsl:template>
1003
1004<!-- ==================================================================== -->
1005
1006<xsl:template match="calloutlist">
1007 <div>
1008 <xsl:call-template name="common.html.attributes"/>
1009 <xsl:call-template name="id.attribute"/>
1010 <xsl:call-template name="anchor"/>
1011 <xsl:if test="title|info/title">
1012 <xsl:call-template name="formal.object.heading"/>
1013 </xsl:if>
1014
1015 <!-- Preserve order of PIs and comments -->
1016 <xsl:apply-templates select="*[not(self::callout or self::title or self::titleabbrev)] |comment()[not(preceding-sibling::callout)] |processing-instruction()[not(preceding-sibling::callout)]"/>
1017
1018 <xsl:choose>
1019 <xsl:when test="$callout.list.table != 0">
1020 <table border="{$table.border.off}">
1021 <xsl:if test="$div.element != 'section'">
1022 <xsl:attribute name="summary">Callout list</xsl:attribute>
1023 </xsl:if>
1024 <xsl:apply-templates select="callout |comment()[preceding-sibling::callout] |processing-instruction()[preceding-sibling::callout]"/>
1025 </table>
1026 </xsl:when>
1027 <xsl:otherwise>
1028 <dl>
1029 <xsl:apply-templates select="." mode="class.attribute"/>
1030 <xsl:apply-templates select="callout |comment()[preceding-sibling::callout] |processing-instruction()[preceding-sibling::callout]"/>
1031 </dl>
1032 </xsl:otherwise>
1033 </xsl:choose>
1034 </div>
1035</xsl:template>
1036
1037<xsl:template match="calloutlist/title">
1038</xsl:template>
1039
1040<xsl:template match="callout">
1041 <xsl:choose>
1042 <xsl:when test="$callout.list.table != 0">
1043 <tr>
1044 <xsl:call-template name="tr.attributes">
1045 <xsl:with-param name="rownum">
1046 <xsl:number from="calloutlist" count="callout"/>
1047 </xsl:with-param>
1048 </xsl:call-template>
1049
1050 <td valign="top" align="{$direction.align.start}">
1051 <xsl:call-template name="id.attribute"/>
1052 <p>
1053 <xsl:call-template name="anchor"/>
1054 <xsl:call-template name="callout.arearefs">
1055 <xsl:with-param name="arearefs" select="@arearefs"/>
1056 </xsl:call-template>
1057 </p>
1058 </td>
1059 <td valign="top" align="{$direction.align.start}">
1060 <xsl:apply-templates/>
1061 </td>
1062 </tr>
1063 </xsl:when>
1064 <xsl:otherwise>
1065 <dt>
1066 <xsl:call-template name="id.attribute"/>
1067 <xsl:call-template name="anchor"/>
1068 <xsl:call-template name="callout.arearefs">
1069 <xsl:with-param name="arearefs" select="@arearefs"/>
1070 </xsl:call-template>
1071 </dt>
1072 <dd><xsl:apply-templates/></dd>
1073 </xsl:otherwise>
1074 </xsl:choose>
1075</xsl:template>
1076
1077<xsl:template match="callout/simpara" priority="2">
1078 <!-- If a callout contains only a single simpara, don't output
1079 the <p> wrapper; this has the effect of creating an li
1080 with simple text content. -->
1081 <xsl:choose>
1082 <xsl:when test="not(preceding-sibling::*) and not (following-sibling::*)">
1083 <xsl:call-template name="anchor"/>
1084 <xsl:apply-templates/>
1085 </xsl:when>
1086 <xsl:otherwise>
1087 <p>
1088 <xsl:call-template name="id.attribute"/>
1089 <xsl:if test="@role and $para.propagates.style != 0">
1090 <xsl:choose>
1091 <xsl:when test="@role and $para.propagates.style != 0">
1092 <xsl:call-template name="common.html.attributes">
1093 <xsl:with-param name="class" select="@role"/>
1094 </xsl:call-template>
1095 </xsl:when>
1096 <xsl:otherwise>
1097 <xsl:call-template name="common.html.attributes"/>
1098 </xsl:otherwise>
1099 </xsl:choose>
1100 </xsl:if>
1101
1102 <xsl:call-template name="anchor"/>
1103 <xsl:apply-templates/>
1104 </p>
1105 </xsl:otherwise>
1106 </xsl:choose>
1107</xsl:template>
1108
1109<xsl:template name="callout.arearefs">
1110 <xsl:param name="arearefs"/>
1111 <xsl:if test="$arearefs!=''">
1112 <xsl:choose>
1113 <xsl:when test="substring-before($arearefs,' ')=''">
1114 <xsl:call-template name="callout.arearef">
1115 <xsl:with-param name="arearef" select="$arearefs"/>
1116 </xsl:call-template>
1117 </xsl:when>
1118 <xsl:otherwise>
1119 <xsl:call-template name="callout.arearef">
1120 <xsl:with-param name="arearef" select="substring-before($arearefs,' ')"/>
1121 </xsl:call-template>
1122 </xsl:otherwise>
1123 </xsl:choose>
1124 <xsl:call-template name="callout.arearefs">
1125 <xsl:with-param name="arearefs" select="substring-after($arearefs,' ')"/>
1126 </xsl:call-template>
1127 </xsl:if>
1128</xsl:template>
1129
1130<xsl:template name="callout.arearef">
1131 <xsl:param name="arearef"/>
1132 <xsl:variable name="targets" select="key('id',$arearef)"/>
1133 <xsl:variable name="target" select="$targets[1]"/>
1134
1135 <xsl:call-template name="check.id.unique">
1136 <xsl:with-param name="linkend" select="$arearef"/>
1137 </xsl:call-template>
1138
1139 <xsl:choose>
1140 <xsl:when test="count($target)=0">
1141 <xsl:text>???</xsl:text>
1142 </xsl:when>
1143 <xsl:when test="local-name($target)='co'">
1144 <a>
1145 <xsl:attribute name="href">
1146 <xsl:text>#</xsl:text>
1147 <xsl:value-of select="$arearef"/>
1148 </xsl:attribute>
1149 <xsl:apply-templates select="$target" mode="callout-bug"/>
1150 </a>
1151 <xsl:text> </xsl:text>
1152 </xsl:when>
1153 <xsl:when test="local-name($target)='areaset'">
1154 <xsl:call-template name="callout-bug">
1155 <xsl:with-param name="conum">
1156 <xsl:apply-templates select="$target" mode="conumber"/>
1157 </xsl:with-param>
1158 </xsl:call-template>
1159 </xsl:when>
1160 <xsl:when test="local-name($target)='area'">
1161 <xsl:choose>
1162 <xsl:when test="$target/parent::areaset">
1163 <xsl:call-template name="callout-bug">
1164 <xsl:with-param name="conum">
1165 <xsl:apply-templates select="$target/parent::areaset" mode="conumber"/>
1166 </xsl:with-param>
1167 </xsl:call-template>
1168 </xsl:when>
1169 <xsl:otherwise>
1170 <xsl:call-template name="callout-bug">
1171 <xsl:with-param name="conum">
1172 <xsl:apply-templates select="$target" mode="conumber"/>
1173 </xsl:with-param>
1174 </xsl:call-template>
1175 </xsl:otherwise>
1176 </xsl:choose>
1177 </xsl:when>
1178 <xsl:otherwise>
1179 <xsl:text>???</xsl:text>
1180 </xsl:otherwise>
1181 </xsl:choose>
1182</xsl:template>
1183
1184<!-- ==================================================================== -->
1185
1186<xsl:template name="orderedlist-starting-number">
1187 <xsl:param name="list" select="."/>
1188 <xsl:variable name="pi-start">
1189 <xsl:call-template name="pi.dbhtml_start">
1190 <xsl:with-param name="node" select="$list"/>
1191 </xsl:call-template>
1192 </xsl:variable>
1193 <xsl:call-template name="output-orderedlist-starting-number">
1194 <xsl:with-param name="list" select="$list"/>
1195 <xsl:with-param name="pi-start" select="$pi-start"/>
1196 </xsl:call-template>
1197</xsl:template>
1198
1199</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.