source: stylesheets/lfs-xsl/docbook-xsl-1.78.1/fo/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 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/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: 46.5 KB
Line 
1<?xml version='1.0'?>
2<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3 xmlns:fo="http://www.w3.org/1999/XSL/Format"
4 version='1.0'>
5
6<!-- ********************************************************************
7 $Id: lists.xsl 9668 2012-11-28 00:47:59Z 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 <xsl:variable name="id">
20 <xsl:call-template name="object.id"/>
21 </xsl:variable>
22
23 <xsl:variable name="keep.together">
24 <xsl:call-template name="pi.dbfo_keep-together"/>
25 </xsl:variable>
26
27 <xsl:variable name="pi-label-width">
28 <xsl:call-template name="pi.dbfo_label-width"/>
29 </xsl:variable>
30
31 <xsl:variable name="label-width">
32 <xsl:choose>
33 <xsl:when test="$pi-label-width = ''">
34 <xsl:value-of select="$itemizedlist.label.width"/>
35 </xsl:when>
36 <xsl:otherwise>
37 <xsl:value-of select="$pi-label-width"/>
38 </xsl:otherwise>
39 </xsl:choose>
40 </xsl:variable>
41
42 <xsl:if test="title">
43 <xsl:apply-templates select="title" mode="list.title.mode"/>
44 </xsl:if>
45
46 <!-- Preserve order of PIs and comments -->
47 <xsl:apply-templates
48 select="*[not(self::listitem
49 or self::title
50 or self::titleabbrev)]
51 |comment()[not(preceding-sibling::listitem)]
52 |processing-instruction()[not(preceding-sibling::listitem)]"/>
53
54 <xsl:variable name="content">
55 <xsl:apply-templates
56 select="listitem
57 |comment()[preceding-sibling::listitem]
58 |processing-instruction()[preceding-sibling::listitem]"/>
59 </xsl:variable>
60
61 <!-- nested lists don't add extra list-block spacing -->
62 <xsl:choose>
63 <xsl:when test="ancestor::listitem">
64 <fo:list-block id="{$id}" xsl:use-attribute-sets="itemizedlist.properties">
65 <xsl:attribute name="provisional-distance-between-starts">
66 <xsl:value-of select="$label-width"/>
67 </xsl:attribute>
68 <xsl:if test="$keep.together != ''">
69 <xsl:attribute name="keep-together.within-column"><xsl:value-of
70 select="$keep.together"/></xsl:attribute>
71 </xsl:if>
72 <xsl:copy-of select="$content"/>
73 </fo:list-block>
74 </xsl:when>
75 <xsl:otherwise>
76 <fo:list-block id="{$id}" xsl:use-attribute-sets="list.block.spacing itemizedlist.properties">
77 <xsl:attribute name="provisional-distance-between-starts">
78 <xsl:value-of select="$label-width"/>
79 </xsl:attribute>
80 <xsl:if test="$keep.together != ''">
81 <xsl:attribute name="keep-together.within-column"><xsl:value-of
82 select="$keep.together"/></xsl:attribute>
83 </xsl:if>
84 <xsl:copy-of select="$content"/>
85 </fo:list-block>
86 </xsl:otherwise>
87 </xsl:choose>
88
89</xsl:template>
90
91<xsl:template match="itemizedlist/title|orderedlist/title">
92 <!--nop-->
93</xsl:template>
94
95<xsl:template match="variablelist/title" mode="vl.as.list">
96 <!--nop-->
97</xsl:template>
98
99<xsl:template match="variablelist/title" mode="vl.as.blocks">
100 <!--nop-->
101</xsl:template>
102
103<xsl:template match="itemizedlist/titleabbrev|orderedlist/titleabbrev">
104 <!--nop-->
105</xsl:template>
106
107<xsl:template match="procedure/titleabbrev">
108 <!--nop-->
109</xsl:template>
110
111<xsl:template match="variablelist/titleabbrev" mode="vl.as.list">
112 <!--nop-->
113</xsl:template>
114
115<xsl:template match="variablelist/titleabbrev" mode="vl.as.blocks">
116 <!--nop-->
117</xsl:template>
118
119<xsl:template match="itemizedlist/listitem">
120 <xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable>
121
122 <xsl:variable name="keep.together">
123 <xsl:call-template name="pi.dbfo_keep-together"/>
124 </xsl:variable>
125
126 <xsl:variable name="item.contents">
127 <fo:list-item-label end-indent="label-end()" xsl:use-attribute-sets="itemizedlist.label.properties">
128 <fo:block>
129 <xsl:call-template name="itemizedlist.label.markup">
130 <xsl:with-param name="itemsymbol">
131 <xsl:call-template name="list.itemsymbol">
132 <xsl:with-param name="node" select="parent::itemizedlist"/>
133 </xsl:call-template>
134 </xsl:with-param>
135 </xsl:call-template>
136 </fo:block>
137 </fo:list-item-label>
138 <fo:list-item-body start-indent="body-start()">
139 <fo:block>
140 <xsl:apply-templates/>
141 </fo:block>
142 </fo:list-item-body>
143 </xsl:variable>
144
145 <xsl:choose>
146 <xsl:when test="parent::*/@spacing = 'compact'">
147 <fo:list-item id="{$id}" xsl:use-attribute-sets="compact.list.item.spacing">
148 <xsl:if test="$keep.together != ''">
149 <xsl:attribute name="keep-together.within-column"><xsl:value-of
150 select="$keep.together"/></xsl:attribute>
151 </xsl:if>
152 <xsl:copy-of select="$item.contents"/>
153 </fo:list-item>
154 </xsl:when>
155 <xsl:otherwise>
156 <fo:list-item id="{$id}" xsl:use-attribute-sets="list.item.spacing">
157 <xsl:if test="$keep.together != ''">
158 <xsl:attribute name="keep-together.within-column"><xsl:value-of
159 select="$keep.together"/></xsl:attribute>
160 </xsl:if>
161 <xsl:copy-of select="$item.contents"/>
162 </fo:list-item>
163 </xsl:otherwise>
164 </xsl:choose>
165</xsl:template>
166
167<xsl:template name="itemizedlist.label.markup">
168 <xsl:param name="itemsymbol" select="'disc'"/>
169
170 <xsl:choose>
171 <xsl:when test="$itemsymbol='none'"></xsl:when>
172 <xsl:when test="$itemsymbol='disc'">&#x2022;</xsl:when>
173 <xsl:when test="$itemsymbol='bullet'">&#x2022;</xsl:when>
174 <xsl:when test="$itemsymbol='endash'">&#x2013;</xsl:when>
175 <xsl:when test="$itemsymbol='emdash'">&#x2014;</xsl:when>
176 <!-- Some of these may work in your XSL-FO processor and fonts -->
177 <!--
178 <xsl:when test="$itemsymbol='square'">&#x25A0;</xsl:when>
179 <xsl:when test="$itemsymbol='box'">&#x25A0;</xsl:when>
180 <xsl:when test="$itemsymbol='smallblacksquare'">&#x25AA;</xsl:when>
181 <xsl:when test="$itemsymbol='circle'">&#x25CB;</xsl:when>
182 <xsl:when test="$itemsymbol='opencircle'">&#x25CB;</xsl:when>
183 <xsl:when test="$itemsymbol='whitesquare'">&#x25A1;</xsl:when>
184 <xsl:when test="$itemsymbol='smallwhitesquare'">&#x25AB;</xsl:when>
185 <xsl:when test="$itemsymbol='round'">&#x25CF;</xsl:when>
186 <xsl:when test="$itemsymbol='blackcircle'">&#x25CF;</xsl:when>
187 <xsl:when test="$itemsymbol='whitebullet'">&#x25E6;</xsl:when>
188 <xsl:when test="$itemsymbol='triangle'">&#x2023;</xsl:when>
189 <xsl:when test="$itemsymbol='point'">&#x203A;</xsl:when>
190 <xsl:when test="$itemsymbol='hand'"><fo:inline
191 font-family="Wingdings 2">A</fo:inline></xsl:when>
192 -->
193 <xsl:otherwise>&#x2022;</xsl:otherwise>
194 </xsl:choose>
195</xsl:template>
196
197<xsl:template match="orderedlist">
198 <xsl:variable name="id">
199 <xsl:call-template name="object.id"/>
200 </xsl:variable>
201
202 <xsl:variable name="pi-label-width">
203 <xsl:call-template name="pi.dbfo_label-width"/>
204 </xsl:variable>
205
206 <xsl:variable name="label-width">
207 <xsl:choose>
208 <xsl:when test="$pi-label-width = ''">
209 <xsl:value-of select="$orderedlist.label.width"/>
210 </xsl:when>
211 <xsl:otherwise>
212 <xsl:value-of select="$pi-label-width"/>
213 </xsl:otherwise>
214 </xsl:choose>
215 </xsl:variable>
216
217 <xsl:variable name="keep.together">
218 <xsl:call-template name="pi.dbfo_keep-together"/>
219 </xsl:variable>
220
221 <xsl:if test="title">
222 <xsl:apply-templates select="title" mode="list.title.mode"/>
223 </xsl:if>
224
225 <!-- Preserve order of PIs and comments -->
226 <xsl:apply-templates
227 select="*[not(self::listitem
228 or self::title
229 or self::titleabbrev)]
230 |comment()[not(preceding-sibling::listitem)]
231 |processing-instruction()[not(preceding-sibling::listitem)]"/>
232
233 <xsl:variable name="content">
234 <xsl:apply-templates
235 select="listitem
236 |comment()[preceding-sibling::listitem]
237 |processing-instruction()[preceding-sibling::listitem]"/>
238 </xsl:variable>
239
240 <!-- nested lists don't add extra list-block spacing -->
241 <xsl:choose>
242 <xsl:when test="ancestor::listitem">
243 <fo:list-block id="{$id}" xsl:use-attribute-sets="orderedlist.properties">
244 <xsl:attribute name="provisional-distance-between-starts">
245 <xsl:value-of select="$label-width"/>
246 </xsl:attribute>
247 <xsl:if test="$keep.together != ''">
248 <xsl:attribute name="keep-together.within-column"><xsl:value-of
249 select="$keep.together"/></xsl:attribute>
250 </xsl:if>
251 <xsl:copy-of select="$content"/>
252 </fo:list-block>
253 </xsl:when>
254 <xsl:otherwise>
255 <fo:list-block id="{$id}" xsl:use-attribute-sets="list.block.spacing orderedlist.properties">
256 <xsl:attribute name="provisional-distance-between-starts">
257 <xsl:value-of select="$label-width"/>
258 </xsl:attribute>
259 <xsl:if test="$keep.together != ''">
260 <xsl:attribute name="keep-together.within-column"><xsl:value-of
261 select="$keep.together"/></xsl:attribute>
262 </xsl:if>
263 <xsl:copy-of select="$content"/>
264 </fo:list-block>
265 </xsl:otherwise>
266 </xsl:choose>
267</xsl:template>
268
269<xsl:template match="orderedlist/listitem">
270 <xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable>
271
272 <xsl:variable name="keep.together">
273 <xsl:call-template name="pi.dbfo_keep-together"/>
274 </xsl:variable>
275
276 <xsl:variable name="item.contents">
277 <fo:list-item-label end-indent="label-end()" xsl:use-attribute-sets="orderedlist.label.properties">
278 <fo:block>
279 <xsl:apply-templates select="." mode="item-number"/>
280 </fo:block>
281 </fo:list-item-label>
282 <fo:list-item-body start-indent="body-start()">
283 <fo:block>
284 <xsl:apply-templates/>
285 </fo:block>
286 </fo:list-item-body>
287 </xsl:variable>
288
289 <xsl:choose>
290 <xsl:when test="parent::*/@spacing = 'compact'">
291 <fo:list-item id="{$id}" xsl:use-attribute-sets="compact.list.item.spacing">
292 <xsl:if test="$keep.together != ''">
293 <xsl:attribute name="keep-together.within-column"><xsl:value-of
294 select="$keep.together"/></xsl:attribute>
295 </xsl:if>
296 <xsl:copy-of select="$item.contents"/>
297 </fo:list-item>
298 </xsl:when>
299 <xsl:otherwise>
300 <fo:list-item id="{$id}" xsl:use-attribute-sets="list.item.spacing">
301 <xsl:if test="$keep.together != ''">
302 <xsl:attribute name="keep-together.within-column"><xsl:value-of
303 select="$keep.together"/></xsl:attribute>
304 </xsl:if>
305 <xsl:copy-of select="$item.contents"/>
306 </fo:list-item>
307 </xsl:otherwise>
308 </xsl:choose>
309</xsl:template>
310
311<xsl:template match="listitem/*[1][local-name()='para' or
312 local-name()='simpara' or
313 local-name()='formalpara']
314 |glossdef/*[1][local-name()='para' or
315 local-name()='simpara' or
316 local-name()='formalpara']
317 |step/*[1][local-name()='para' or
318 local-name()='simpara' or
319 local-name()='formalpara']
320 |callout/*[1][local-name()='para' or
321 local-name()='simpara' or
322 local-name()='formalpara']"
323 priority="2">
324 <fo:block>
325 <xsl:call-template name="anchor"/>
326 <xsl:apply-templates/>
327 </fo:block>
328</xsl:template>
329
330<xsl:template match="variablelist">
331 <xsl:variable name="presentation">
332 <xsl:call-template name="pi.dbfo_list-presentation"/>
333 </xsl:variable>
334
335 <xsl:choose>
336 <xsl:when test="$presentation = 'list'">
337 <xsl:apply-templates select="." mode="vl.as.list"/>
338 </xsl:when>
339 <xsl:when test="$presentation = 'blocks'">
340 <xsl:apply-templates select="." mode="vl.as.blocks"/>
341 </xsl:when>
342 <xsl:when test="$variablelist.as.blocks != 0">
343 <xsl:apply-templates select="." mode="vl.as.blocks"/>
344 </xsl:when>
345 <xsl:otherwise>
346 <xsl:apply-templates select="." mode="vl.as.list"/>
347 </xsl:otherwise>
348 </xsl:choose>
349</xsl:template>
350
351<xsl:template match="variablelist" mode="vl.as.list">
352 <xsl:variable name="id">
353 <xsl:call-template name="object.id"/>
354 </xsl:variable>
355
356 <xsl:variable name="keep.together">
357 <xsl:call-template name="pi.dbfo_keep-together"/>
358 </xsl:variable>
359
360 <xsl:variable name="term-width">
361 <xsl:call-template name="pi.dbfo_term-width"/>
362 </xsl:variable>
363
364 <xsl:variable name="termlength">
365 <xsl:choose>
366 <xsl:when test="$term-width != ''">
367 <xsl:value-of select="$term-width"/>
368 </xsl:when>
369 <xsl:when test="@termlength">
370 <xsl:variable name="termlength.is.number">
371 <xsl:value-of select="@termlength + 0"/>
372 </xsl:variable>
373 <xsl:choose>
374 <xsl:when test="string($termlength.is.number) = 'NaN'">
375 <!-- if the term length isn't just a number, assume it's a measurement -->
376 <xsl:value-of select="@termlength"/>
377 </xsl:when>
378 <xsl:otherwise>
379 <xsl:value-of select="@termlength"/>
380 <xsl:text>em * 0.60</xsl:text>
381 </xsl:otherwise>
382 </xsl:choose>
383 </xsl:when>
384 <xsl:otherwise>
385 <xsl:call-template name="longest.term">
386 <xsl:with-param name="terms" select="varlistentry/term"/>
387 <xsl:with-param name="maxlength" select="$variablelist.max.termlength"/>
388 </xsl:call-template>
389 <xsl:text>em * 0.60</xsl:text>
390 </xsl:otherwise>
391 </xsl:choose>
392 </xsl:variable>
393
394<!--
395 <xsl:message>
396 <xsl:text>term width: </xsl:text>
397 <xsl:value-of select="$termlength"/>
398 </xsl:message>
399-->
400
401 <xsl:variable name="label-separation">1em</xsl:variable>
402 <xsl:variable name="distance-between-starts">
403 <xsl:value-of select="$termlength"/>
404 <xsl:text>+</xsl:text>
405 <xsl:value-of select="$label-separation"/>
406 </xsl:variable>
407
408 <xsl:if test="title">
409 <xsl:apply-templates select="title" mode="list.title.mode"/>
410 </xsl:if>
411
412 <!-- Preserve order of PIs and comments -->
413 <xsl:apply-templates
414 select="*[not(self::varlistentry
415 or self::title
416 or self::titleabbrev)]
417 |comment()[not(preceding-sibling::varlistentry)]
418 |processing-instruction()[not(preceding-sibling::varlistentry)]"/>
419
420 <xsl:variable name="content">
421 <xsl:apply-templates mode="vl.as.list"
422 select="varlistentry
423 |comment()[preceding-sibling::varlistentry]
424 |processing-instruction()[preceding-sibling::varlistentry]"/>
425 </xsl:variable>
426
427 <!-- nested lists don't add extra list-block spacing -->
428 <xsl:choose>
429 <xsl:when test="ancestor::listitem">
430 <fo:list-block id="{$id}"
431 provisional-distance-between-starts=
432 "{$distance-between-starts}"
433 provisional-label-separation="{$label-separation}">
434 <xsl:if test="$keep.together != ''">
435 <xsl:attribute name="keep-together.within-column"><xsl:value-of
436 select="$keep.together"/></xsl:attribute>
437 </xsl:if>
438 <xsl:copy-of select="$content"/>
439 </fo:list-block>
440 </xsl:when>
441 <xsl:otherwise>
442 <fo:list-block id="{$id}"
443 provisional-distance-between-starts=
444 "{$distance-between-starts}"
445 provisional-label-separation="{$label-separation}"
446 xsl:use-attribute-sets="list.block.spacing">
447 <xsl:if test="$keep.together != ''">
448 <xsl:attribute name="keep-together.within-column"><xsl:value-of
449 select="$keep.together"/></xsl:attribute>
450 </xsl:if>
451 <xsl:copy-of select="$content"/>
452 </fo:list-block>
453 </xsl:otherwise>
454 </xsl:choose>
455</xsl:template>
456
457<xsl:template name="longest.term">
458 <xsl:param name="longest" select="0"/>
459 <xsl:param name="terms" select="."/>
460 <xsl:param name="maxlength" select="-1"/>
461
462 <!-- Process out any indexterms in the term -->
463 <xsl:variable name="term.text">
464 <xsl:apply-templates select="$terms[1]"/>
465 </xsl:variable>
466
467 <xsl:choose>
468 <xsl:when test="$longest &gt; $maxlength and $maxlength &gt; 0">
469 <xsl:value-of select="$maxlength"/>
470 </xsl:when>
471 <xsl:when test="not($terms)">
472 <xsl:value-of select="$longest"/>
473 </xsl:when>
474 <xsl:when test="string-length($term.text) &gt; $longest">
475 <xsl:call-template name="longest.term">
476 <xsl:with-param name="longest"
477 select="string-length($term.text)"/>
478 <xsl:with-param name="maxlength" select="$maxlength"/>
479 <xsl:with-param name="terms" select="$terms[position() &gt; 1]"/>
480 </xsl:call-template>
481 </xsl:when>
482 <xsl:otherwise>
483 <xsl:call-template name="longest.term">
484 <xsl:with-param name="longest" select="$longest"/>
485 <xsl:with-param name="maxlength" select="$maxlength"/>
486 <xsl:with-param name="terms" select="$terms[position() &gt; 1]"/>
487 </xsl:call-template>
488 </xsl:otherwise>
489 </xsl:choose>
490</xsl:template>
491
492<xsl:template match="varlistentry" mode="vl.as.list">
493 <xsl:variable name="id">
494 <xsl:call-template name="object.id"/>
495 </xsl:variable>
496
497 <xsl:variable name="keep.together">
498 <xsl:call-template name="pi.dbfo_keep-together"/>
499 </xsl:variable>
500
501 <xsl:variable name="item.contents">
502 <fo:list-item-label end-indent="label-end()" text-align="start">
503 <fo:block xsl:use-attribute-sets="variablelist.term.properties">
504 <xsl:apply-templates select="term"/>
505 </fo:block>
506 </fo:list-item-label>
507 <fo:list-item-body start-indent="body-start()">
508 <fo:block>
509 <xsl:apply-templates select="listitem"/>
510 </fo:block>
511 </fo:list-item-body>
512 </xsl:variable>
513
514 <xsl:choose>
515 <xsl:when test="parent::*/@spacing = 'compact'">
516 <fo:list-item id="{$id}"
517 xsl:use-attribute-sets="compact.list.item.spacing">
518 <xsl:if test="$keep.together != ''">
519 <xsl:attribute name="keep-together.within-column"><xsl:value-of
520 select="$keep.together"/></xsl:attribute>
521 </xsl:if>
522 <xsl:copy-of select="$item.contents"/>
523 </fo:list-item>
524 </xsl:when>
525 <xsl:otherwise>
526 <fo:list-item id="{$id}" xsl:use-attribute-sets="list.item.spacing">
527 <xsl:if test="$keep.together != ''">
528 <xsl:attribute name="keep-together.within-column"><xsl:value-of
529 select="$keep.together"/></xsl:attribute>
530 </xsl:if>
531 <xsl:copy-of select="$item.contents"/>
532 </fo:list-item>
533 </xsl:otherwise>
534 </xsl:choose>
535</xsl:template>
536
537
538<xsl:template match="variablelist" mode="vl.as.blocks">
539 <xsl:variable name="id">
540 <xsl:call-template name="object.id"/>
541 </xsl:variable>
542
543 <!-- termlength is irrelevant -->
544
545 <xsl:if test="title">
546 <xsl:apply-templates select="title" mode="list.title.mode"/>
547 </xsl:if>
548
549 <!-- Preserve order of PIs and comments -->
550 <xsl:apply-templates
551 select="*[not(self::varlistentry
552 or self::title
553 or self::titleabbrev)]
554 |comment()[not(preceding-sibling::varlistentry)]
555 |processing-instruction()[not(preceding-sibling::varlistentry)]"/>
556
557 <xsl:variable name="content">
558 <xsl:apply-templates mode="vl.as.blocks"
559 select="varlistentry
560 |comment()[preceding-sibling::varlistentry]
561 |processing-instruction()[preceding-sibling::varlistentry]"/>
562 </xsl:variable>
563
564 <!-- nested lists don't add extra list-block spacing -->
565 <xsl:choose>
566 <xsl:when test="ancestor::listitem">
567 <fo:block id="{$id}">
568 <xsl:copy-of select="$content"/>
569 </fo:block>
570 </xsl:when>
571 <xsl:otherwise>
572 <fo:block id="{$id}" xsl:use-attribute-sets="list.block.spacing">
573 <xsl:copy-of select="$content"/>
574 </fo:block>
575 </xsl:otherwise>
576 </xsl:choose>
577</xsl:template>
578
579<xsl:template match="varlistentry" mode="vl.as.blocks">
580 <xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable>
581
582 <fo:block id="{$id}" xsl:use-attribute-sets="variablelist.term.properties
583 list.item.spacing"
584 keep-together.within-column="always"
585 keep-with-next.within-column="always">
586 <xsl:apply-templates select="term"/>
587 </fo:block>
588
589 <fo:block>
590 <xsl:attribute name="margin-{$direction.align.start}">0.25in</xsl:attribute>
591 <xsl:apply-templates select="listitem"/>
592 </fo:block>
593</xsl:template>
594
595<xsl:template match="varlistentry/term">
596 <fo:inline>
597 <xsl:call-template name="simple.xlink">
598 <xsl:with-param name="content">
599 <xsl:apply-templates/>
600 </xsl:with-param>
601 </xsl:call-template>
602 </fo:inline>
603 <xsl:choose>
604 <xsl:when test="not(following-sibling::term)"/> <!-- do nothing -->
605 <xsl:otherwise>
606 <!-- * if we have multiple terms in the same varlistentry, generate -->
607 <!-- * a separator (", " by default) and/or an additional line -->
608 <!-- * break after each one except the last -->
609 <fo:inline><xsl:value-of select="$variablelist.term.separator"/></fo:inline>
610 <xsl:if test="not($variablelist.term.break.after = '0')">
611 <fo:block/>
612 </xsl:if>
613 </xsl:otherwise>
614 </xsl:choose>
615</xsl:template>
616
617<xsl:template match="varlistentry/listitem">
618 <xsl:apply-templates/>
619</xsl:template>
620
621<!-- ==================================================================== -->
622
623<xsl:template match="title" mode="list.title.mode">
624 <xsl:call-template name="formal.object.heading">
625 <xsl:with-param name="object" select=".."/>
626 </xsl:call-template>
627</xsl:template>
628
629<!-- ==================================================================== -->
630
631<xsl:template match="simplelist|simplelist[@type='vert']">
632 <!-- with no type specified, the default is 'vert' -->
633
634 <xsl:variable name="id">
635 <xsl:call-template name="object.id"/>
636 </xsl:variable>
637
638 <xsl:variable name="explicit.table.width">
639 <xsl:call-template name="dbfo-attribute">
640 <xsl:with-param name="pis"
641 select="processing-instruction('dbfo')"/>
642 <xsl:with-param name="attribute" select="'list-width'"/>
643 </xsl:call-template>
644 </xsl:variable>
645
646 <xsl:variable name="table.width">
647 <xsl:choose>
648 <xsl:when test="$explicit.table.width != ''">
649 <xsl:value-of select="$explicit.table.width"/>
650 </xsl:when>
651 <xsl:when test="$default.table.width = ''">
652 <xsl:text>100%</xsl:text>
653 </xsl:when>
654 <xsl:otherwise>
655 <xsl:value-of select="$default.table.width"/>
656 </xsl:otherwise>
657 </xsl:choose>
658 </xsl:variable>
659
660 <fo:table id="{$id}" xsl:use-attribute-sets="normal.para.spacing">
661
662 <xsl:choose>
663 <xsl:when test="$axf.extensions != 0 or $xep.extensions != 0">
664 <xsl:attribute name="table-layout">auto</xsl:attribute>
665 <xsl:if test="$explicit.table.width != ''">
666 <xsl:attribute name="width"><xsl:value-of
667 select="$explicit.table.width"/></xsl:attribute>
668 </xsl:if>
669 </xsl:when>
670 <xsl:otherwise>
671 <xsl:attribute name="table-layout">fixed</xsl:attribute>
672 <xsl:attribute name="width"><xsl:value-of
673 select="$table.width"/></xsl:attribute>
674 </xsl:otherwise>
675 </xsl:choose>
676
677 <xsl:call-template name="simplelist.table.columns">
678 <xsl:with-param name="cols">
679 <xsl:choose>
680 <xsl:when test="@columns">
681 <xsl:value-of select="@columns"/>
682 </xsl:when>
683 <xsl:otherwise>1</xsl:otherwise>
684 </xsl:choose>
685 </xsl:with-param>
686 </xsl:call-template>
687 <fo:table-body start-indent="0pt" end-indent="0pt">
688 <xsl:call-template name="simplelist.vert">
689 <xsl:with-param name="cols">
690 <xsl:choose>
691 <xsl:when test="@columns">
692 <xsl:value-of select="@columns"/>
693 </xsl:when>
694 <xsl:otherwise>1</xsl:otherwise>
695 </xsl:choose>
696 </xsl:with-param>
697 </xsl:call-template>
698 </fo:table-body>
699 </fo:table>
700</xsl:template>
701
702<xsl:template match="simplelist[@type='inline']">
703 <!-- if dbchoice PI exists, use that to determine the choice separator -->
704 <!-- (that is, equivalent of "and" or "or" in current locale), or literal -->
705 <!-- value of "choice" otherwise -->
706 <xsl:variable name="id">
707 <xsl:call-template name="object.id"/>
708 </xsl:variable>
709
710 <fo:inline id="{$id}"><xsl:variable name="localized-choice-separator">
711 <xsl:choose>
712 <xsl:when test="processing-instruction('dbchoice')">
713 <xsl:call-template name="select.choice.separator"/>
714 </xsl:when>
715 <xsl:otherwise>
716 <!-- empty -->
717 </xsl:otherwise>
718 </xsl:choose>
719 </xsl:variable>
720
721 <xsl:for-each select="member">
722 <xsl:apply-templates/>
723 <xsl:choose>
724 <xsl:when test="position() = last()"/> <!-- do nothing -->
725 <xsl:otherwise>
726 <xsl:text>, </xsl:text>
727 <xsl:if test="position() = last() - 1">
728 <xsl:if test="$localized-choice-separator != ''">
729 <xsl:value-of select="$localized-choice-separator"/>
730 <xsl:text> </xsl:text>
731 </xsl:if>
732 </xsl:if>
733 </xsl:otherwise>
734 </xsl:choose>
735 </xsl:for-each></fo:inline>
736</xsl:template>
737
738<xsl:template match="simplelist[@type='horiz']">
739
740 <xsl:variable name="id">
741 <xsl:call-template name="object.id"/>
742 </xsl:variable>
743
744 <xsl:variable name="explicit.table.width">
745 <xsl:call-template name="pi.dbfo_list-width"/>
746 </xsl:variable>
747
748 <xsl:variable name="table.width">
749 <xsl:choose>
750 <xsl:when test="$explicit.table.width != ''">
751 <xsl:value-of select="$explicit.table.width"/>
752 </xsl:when>
753 <xsl:when test="$default.table.width = ''">
754 <xsl:text>100%</xsl:text>
755 </xsl:when>
756 <xsl:otherwise>
757 <xsl:value-of select="$default.table.width"/>
758 </xsl:otherwise>
759 </xsl:choose>
760 </xsl:variable>
761
762 <fo:table id="{$id}" xsl:use-attribute-sets="normal.para.spacing">
763 <xsl:choose>
764 <xsl:when test="$axf.extensions != 0 or $xep.extensions != 0">
765 <xsl:attribute name="table-layout">auto</xsl:attribute>
766 <xsl:if test="$explicit.table.width != ''">
767 <xsl:attribute name="width"><xsl:value-of
768 select="$explicit.table.width"/></xsl:attribute>
769 </xsl:if>
770 </xsl:when>
771 <xsl:otherwise>
772 <xsl:attribute name="table-layout">fixed</xsl:attribute>
773 <xsl:attribute name="width"><xsl:value-of
774 select="$table.width"/></xsl:attribute>
775 </xsl:otherwise>
776 </xsl:choose>
777 <xsl:call-template name="simplelist.table.columns">
778 <xsl:with-param name="cols">
779 <xsl:choose>
780 <xsl:when test="@columns">
781 <xsl:value-of select="@columns"/>
782 </xsl:when>
783 <xsl:otherwise>1</xsl:otherwise>
784 </xsl:choose>
785 </xsl:with-param>
786 </xsl:call-template>
787 <fo:table-body start-indent="0pt" end-indent="0pt">
788 <xsl:call-template name="simplelist.horiz">
789 <xsl:with-param name="cols">
790 <xsl:choose>
791 <xsl:when test="@columns">
792 <xsl:value-of select="@columns"/>
793 </xsl:when>
794 <xsl:otherwise>1</xsl:otherwise>
795 </xsl:choose>
796 </xsl:with-param>
797 </xsl:call-template>
798 </fo:table-body>
799 </fo:table>
800</xsl:template>
801
802<xsl:template name="simplelist.table.columns">
803 <xsl:param name="cols" select="1"/>
804 <xsl:param name="curcol" select="1"/>
805 <fo:table-column column-number="{$curcol}"
806 column-width="proportional-column-width(1)"/>
807 <xsl:if test="$curcol &lt; $cols">
808 <xsl:call-template name="simplelist.table.columns">
809 <xsl:with-param name="cols" select="$cols"/>
810 <xsl:with-param name="curcol" select="$curcol + 1"/>
811 </xsl:call-template>
812 </xsl:if>
813</xsl:template>
814
815<xsl:template name="simplelist.horiz">
816 <xsl:param name="cols">1</xsl:param>
817 <xsl:param name="cell">1</xsl:param>
818 <xsl:param name="members" select="./member"/>
819
820 <xsl:if test="$cell &lt;= count($members)">
821 <fo:table-row>
822 <xsl:call-template name="simplelist.horiz.row">
823 <xsl:with-param name="cols" select="$cols"/>
824 <xsl:with-param name="cell" select="$cell"/>
825 <xsl:with-param name="members" select="$members"/>
826 </xsl:call-template>
827 </fo:table-row>
828 <xsl:call-template name="simplelist.horiz">
829 <xsl:with-param name="cols" select="$cols"/>
830 <xsl:with-param name="cell" select="$cell + $cols"/>
831 <xsl:with-param name="members" select="$members"/>
832 </xsl:call-template>
833 </xsl:if>
834</xsl:template>
835
836<xsl:template name="simplelist.horiz.row">
837 <xsl:param name="cols">1</xsl:param>
838 <xsl:param name="cell">1</xsl:param>
839 <xsl:param name="members" select="./member"/>
840 <xsl:param name="curcol">1</xsl:param>
841
842 <xsl:if test="$curcol &lt;= $cols">
843 <fo:table-cell>
844 <fo:block>
845 <xsl:if test="$members[position()=$cell]">
846 <xsl:apply-templates select="$members[position()=$cell]"/>
847 </xsl:if>
848 </fo:block>
849 </fo:table-cell>
850 <xsl:call-template name="simplelist.horiz.row">
851 <xsl:with-param name="cols" select="$cols"/>
852 <xsl:with-param name="cell" select="$cell+1"/>
853 <xsl:with-param name="members" select="$members"/>
854 <xsl:with-param name="curcol" select="$curcol+1"/>
855 </xsl:call-template>
856 </xsl:if>
857</xsl:template>
858
859<xsl:template name="simplelist.vert">
860 <xsl:param name="cols">1</xsl:param>
861 <xsl:param name="cell">1</xsl:param>
862 <xsl:param name="members" select="./member"/>
863 <xsl:param name="rows"
864 select="floor((count($members)+$cols - 1) div $cols)"/>
865
866 <xsl:if test="$cell &lt;= $rows">
867 <fo:table-row>
868 <xsl:call-template name="simplelist.vert.row">
869 <xsl:with-param name="cols" select="$cols"/>
870 <xsl:with-param name="rows" select="$rows"/>
871 <xsl:with-param name="cell" select="$cell"/>
872 <xsl:with-param name="members" select="$members"/>
873 </xsl:call-template>
874 </fo:table-row>
875 <xsl:call-template name="simplelist.vert">
876 <xsl:with-param name="cols" select="$cols"/>
877 <xsl:with-param name="cell" select="$cell+1"/>
878 <xsl:with-param name="members" select="$members"/>
879 <xsl:with-param name="rows" select="$rows"/>
880 </xsl:call-template>
881 </xsl:if>
882</xsl:template>
883
884<xsl:template name="simplelist.vert.row">
885 <xsl:param name="cols">1</xsl:param>
886 <xsl:param name="rows">1</xsl:param>
887 <xsl:param name="cell">1</xsl:param>
888 <xsl:param name="members" select="./member"/>
889 <xsl:param name="curcol">1</xsl:param>
890
891 <xsl:if test="$curcol &lt;= $cols">
892 <fo:table-cell>
893 <fo:block>
894 <xsl:if test="$members[position()=$cell]">
895 <xsl:apply-templates select="$members[position()=$cell]"/>
896 </xsl:if>
897 </fo:block>
898 </fo:table-cell>
899 <xsl:call-template name="simplelist.vert.row">
900 <xsl:with-param name="cols" select="$cols"/>
901 <xsl:with-param name="rows" select="$rows"/>
902 <xsl:with-param name="cell" select="$cell+$rows"/>
903 <xsl:with-param name="members" select="$members"/>
904 <xsl:with-param name="curcol" select="$curcol+1"/>
905 </xsl:call-template>
906 </xsl:if>
907</xsl:template>
908
909<xsl:template match="member">
910 <xsl:call-template name="simple.xlink">
911 <xsl:with-param name="content">
912 <xsl:apply-templates/>
913 </xsl:with-param>
914 </xsl:call-template>
915</xsl:template>
916
917<!-- ==================================================================== -->
918
919<xsl:template match="procedure">
920 <xsl:variable name="id">
921 <xsl:call-template name="object.id"/>
922 </xsl:variable>
923
924 <xsl:variable name="param.placement"
925 select="substring-after(normalize-space($formal.title.placement),
926 concat(local-name(.), ' '))"/>
927
928 <xsl:variable name="placement">
929 <xsl:choose>
930 <xsl:when test="contains($param.placement, ' ')">
931 <xsl:value-of select="substring-before($param.placement, ' ')"/>
932 </xsl:when>
933 <xsl:when test="$param.placement = ''">before</xsl:when>
934 <xsl:otherwise>
935 <xsl:value-of select="$param.placement"/>
936 </xsl:otherwise>
937 </xsl:choose>
938 </xsl:variable>
939
940 <!-- Preserve order of PIs and comments -->
941 <xsl:variable name="preamble"
942 select="*[not(self::step
943 or self::title
944 or self::titleabbrev)]
945 |comment()[not(preceding-sibling::step)]
946 |processing-instruction()[not(preceding-sibling::step)]"/>
947
948 <xsl:variable name="steps"
949 select="step
950 |comment()[preceding-sibling::step]
951 |processing-instruction()[preceding-sibling::step]"/>
952
953 <fo:block id="{$id}" xsl:use-attribute-sets="procedure.properties list.block.spacing">
954 <xsl:if test="./title and $placement = 'before'">
955 <!-- n.b. gentext code tests for $formal.procedures and may make an "informal" -->
956 <!-- heading even though we called formal.object.heading. odd but true. -->
957 <xsl:call-template name="formal.object.heading"/>
958 </xsl:if>
959
960 <xsl:apply-templates select="$preamble"/>
961
962 <fo:list-block xsl:use-attribute-sets="list.block.spacing"
963 provisional-distance-between-starts="2em"
964 provisional-label-separation="0.2em">
965 <xsl:apply-templates select="$steps"/>
966 </fo:list-block>
967
968 <xsl:if test="./title and $placement != 'before'">
969 <!-- n.b. gentext code tests for $formal.procedures and may make an "informal" -->
970 <!-- heading even though we called formal.object.heading. odd but true. -->
971 <xsl:call-template name="formal.object.heading"/>
972 </xsl:if>
973 </fo:block>
974</xsl:template>
975
976<xsl:template match="procedure/title">
977</xsl:template>
978
979<xsl:template match="substeps">
980 <fo:list-block xsl:use-attribute-sets="list.block.spacing"
981 provisional-distance-between-starts="2em"
982 provisional-label-separation="0.2em">
983 <xsl:apply-templates/>
984 </fo:list-block>
985</xsl:template>
986
987<xsl:template match="procedure/step|substeps/step">
988 <xsl:variable name="id">
989 <xsl:call-template name="object.id"/>
990 </xsl:variable>
991
992 <xsl:variable name="keep.together">
993 <xsl:call-template name="pi.dbfo_keep-together"/>
994 </xsl:variable>
995
996 <fo:list-item xsl:use-attribute-sets="list.item.spacing">
997 <xsl:if test="$keep.together != ''">
998 <xsl:attribute name="keep-together.within-column"><xsl:value-of
999 select="$keep.together"/></xsl:attribute>
1000 </xsl:if>
1001 <fo:list-item-label end-indent="label-end()">
1002 <fo:block id="{$id}">
1003 <!-- dwc: fix for one step procedures. Use a bullet if there's no step 2 -->
1004 <xsl:choose>
1005 <xsl:when test="count(../step) = 1">
1006 <xsl:text>&#x2022;</xsl:text>
1007 </xsl:when>
1008 <xsl:otherwise>
1009 <xsl:apply-templates select="." mode="number">
1010 <xsl:with-param name="recursive" select="0"/>
1011 </xsl:apply-templates>.
1012 </xsl:otherwise>
1013 </xsl:choose>
1014 </fo:block>
1015 </fo:list-item-label>
1016 <fo:list-item-body start-indent="body-start()">
1017 <fo:block>
1018 <xsl:apply-templates/>
1019 </fo:block>
1020 </fo:list-item-body>
1021 </fo:list-item>
1022</xsl:template>
1023
1024<xsl:template match="stepalternatives">
1025 <fo:list-block provisional-distance-between-starts="2em"
1026 provisional-label-separation="0.2em">
1027 <xsl:apply-templates select="step"/>
1028 </fo:list-block>
1029</xsl:template>
1030
1031<xsl:template match="stepalternatives/step">
1032 <xsl:variable name="id">
1033 <xsl:call-template name="object.id"/>
1034 </xsl:variable>
1035
1036 <xsl:variable name="keep.together">
1037 <xsl:call-template name="pi.dbfo_keep-together"/>
1038 </xsl:variable>
1039
1040 <fo:list-item xsl:use-attribute-sets="list.item.spacing">
1041 <xsl:if test="$keep.together != ''">
1042 <xsl:attribute name="keep-together.within-column"><xsl:value-of
1043 select="$keep.together"/></xsl:attribute>
1044 </xsl:if>
1045 <fo:list-item-label end-indent="label-end()">
1046 <fo:block id="{$id}">
1047 <xsl:text>&#x2022;</xsl:text>
1048 </fo:block>
1049 </fo:list-item-label>
1050 <fo:list-item-body start-indent="body-start()">
1051 <fo:block>
1052 <xsl:apply-templates/>
1053 </fo:block>
1054 </fo:list-item-body>
1055 </fo:list-item>
1056</xsl:template>
1057
1058<xsl:template match="step/title">
1059 <fo:block font-weight="bold"
1060 keep-together.within-column="always"
1061 keep-with-next.within-column="always">
1062 <xsl:apply-templates/>
1063 </fo:block>
1064</xsl:template>
1065
1066<!-- ==================================================================== -->
1067
1068<xsl:template match="segmentedlist">
1069 <xsl:variable name="presentation">
1070 <xsl:call-template name="pi.dbfo_list-presentation"/>
1071 </xsl:variable>
1072
1073 <xsl:variable name="keep.together">
1074 <xsl:call-template name="pi.dbfo_keep-together"/>
1075 </xsl:variable>
1076
1077 <xsl:variable name="id">
1078 <xsl:call-template name="object.id"/>
1079 </xsl:variable>
1080
1081 <xsl:choose>
1082 <xsl:when test="$presentation = 'table'">
1083 <fo:block id="{$id}">
1084 <xsl:if test="$keep.together != ''">
1085 <xsl:attribute name="keep-together.within-column"><xsl:value-of
1086 select="$keep.together"/></xsl:attribute>
1087 </xsl:if>
1088 <xsl:apply-templates select="." mode="seglist-table"/>
1089 </fo:block>
1090 </xsl:when>
1091 <xsl:when test="$presentation = 'list'">
1092 <fo:block id="{$id}">
1093 <xsl:if test="$keep.together != ''">
1094 <xsl:attribute name="keep-together.within-column"><xsl:value-of
1095 select="$keep.together"/></xsl:attribute>
1096 </xsl:if>
1097 <xsl:apply-templates/>
1098 </fo:block>
1099 </xsl:when>
1100 <xsl:when test="$segmentedlist.as.table != 0">
1101 <fo:block id="{$id}">
1102 <xsl:if test="$keep.together != ''">
1103 <xsl:attribute name="keep-together.within-column"><xsl:value-of
1104 select="$keep.together"/></xsl:attribute>
1105 </xsl:if>
1106 <xsl:apply-templates select="." mode="seglist-table"/>
1107 </fo:block>
1108 </xsl:when>
1109 <xsl:otherwise>
1110 <fo:block id="{$id}">
1111 <xsl:if test="$keep.together != ''">
1112 <xsl:attribute name="keep-together.within-column"><xsl:value-of
1113 select="$keep.together"/></xsl:attribute>
1114 </xsl:if>
1115
1116 <xsl:apply-templates/>
1117 </fo:block>
1118 </xsl:otherwise>
1119 </xsl:choose>
1120</xsl:template>
1121
1122<xsl:template match="segmentedlist/title">
1123 <xsl:apply-templates select="." mode="list.title.mode" />
1124</xsl:template>
1125
1126<xsl:template match="segtitle">
1127</xsl:template>
1128
1129<xsl:template match="segtitle" mode="segtitle-in-seg">
1130 <xsl:apply-templates/>
1131</xsl:template>
1132
1133<xsl:template match="seglistitem">
1134 <xsl:variable name="id">
1135 <xsl:call-template name="object.id"/>
1136 </xsl:variable>
1137 <fo:block id="{$id}">
1138 <xsl:apply-templates/>
1139 </fo:block>
1140</xsl:template>
1141
1142<xsl:template match="seg">
1143 <xsl:variable name="segnum" select="count(preceding-sibling::seg)+1"/>
1144 <xsl:variable name="seglist" select="ancestor::segmentedlist"/>
1145 <xsl:variable name="segtitles" select="$seglist/segtitle"/>
1146
1147 <!--
1148 Note: segtitle is only going to be the right thing in a well formed
1149 SegmentedList. If there are too many Segs or too few SegTitles,
1150 you'll get something odd...maybe an error
1151 -->
1152
1153 <fo:block>
1154 <fo:inline font-weight="bold">
1155 <xsl:apply-templates select="$segtitles[$segnum=position()]"
1156 mode="segtitle-in-seg"/>
1157 <xsl:text>: </xsl:text>
1158 </fo:inline>
1159 <xsl:apply-templates/>
1160 </fo:block>
1161</xsl:template>
1162
1163<xsl:template match="segmentedlist" mode="seglist-table">
1164 <xsl:apply-templates select="title" mode="list.title.mode" />
1165 <fo:table table-layout="fixed">
1166 <xsl:call-template name="segmentedlist.table.columns">
1167 <xsl:with-param name="cols" select="count(segtitle)"/>
1168 </xsl:call-template>
1169 <fo:table-header start-indent="0pt" end-indent="0pt">
1170 <fo:table-row>
1171 <xsl:apply-templates select="segtitle" mode="seglist-table"/>
1172 </fo:table-row>
1173 </fo:table-header>
1174 <fo:table-body start-indent="0pt" end-indent="0pt">
1175 <xsl:apply-templates select="seglistitem" mode="seglist-table"/>
1176 </fo:table-body>
1177 </fo:table>
1178</xsl:template>
1179
1180<xsl:template name="segmentedlist.table.columns">
1181 <xsl:param name="cols" select="1"/>
1182 <xsl:param name="curcol" select="1"/>
1183
1184 <fo:table-column column-number="{$curcol}"
1185 column-width="proportional-column-width(1)"/>
1186 <xsl:if test="$curcol &lt; $cols">
1187 <xsl:call-template name="segmentedlist.table.columns">
1188 <xsl:with-param name="cols" select="$cols"/>
1189 <xsl:with-param name="curcol" select="$curcol+1"/>
1190 </xsl:call-template>
1191 </xsl:if>
1192</xsl:template>
1193
1194<xsl:template match="segtitle" mode="seglist-table">
1195 <fo:table-cell>
1196 <fo:block font-weight="bold">
1197 <xsl:apply-templates/>
1198 </fo:block>
1199 </fo:table-cell>
1200</xsl:template>
1201
1202<xsl:template match="seglistitem" mode="seglist-table">
1203 <xsl:variable name="id">
1204 <xsl:call-template name="object.id"/>
1205 </xsl:variable>
1206 <fo:table-row id="{$id}">
1207 <xsl:apply-templates mode="seglist-table"/>
1208 </fo:table-row>
1209</xsl:template>
1210
1211<xsl:template match="seg" mode="seglist-table">
1212 <fo:table-cell>
1213 <fo:block>
1214 <xsl:apply-templates/>
1215 </fo:block>
1216 </fo:table-cell>
1217</xsl:template>
1218
1219<!-- ==================================================================== -->
1220
1221<xsl:template match="calloutlist">
1222 <xsl:variable name="id">
1223 <xsl:call-template name="object.id"/>
1224 </xsl:variable>
1225
1226 <xsl:variable name="pi-label-width">
1227 <xsl:call-template name="pi.dbfo_label-width"/>
1228 </xsl:variable>
1229
1230 <fo:block id="{$id}"
1231 text-align="{$alignment}">
1232 <!-- The above restores alignment altered by image align attribute -->
1233 <xsl:if test="title|info/title">
1234 <xsl:apply-templates select="(title|info/title)[1]"
1235 mode="list.title.mode"/>
1236 </xsl:if>
1237
1238 <!-- Preserve order of PIs and comments -->
1239 <xsl:apply-templates
1240 select="*[not(self::callout or self::title or self::titleabbrev)]
1241 |comment()[not(preceding-sibling::callout)]
1242 |processing-instruction()[not(preceding-sibling::callout)]"/>
1243
1244 <fo:list-block xsl:use-attribute-sets="calloutlist.properties">
1245
1246 <xsl:if test="$pi-label-width != ''">
1247 <xsl:attribute name="provisional-distance-between-starts">
1248 <xsl:value-of select="$pi-label-width"/>
1249 </xsl:attribute>
1250 </xsl:if>
1251
1252 <xsl:apply-templates select="callout
1253 |comment()[preceding-sibling::callout]
1254 |processing-instruction()[preceding-sibling::callout]"/>
1255 </fo:list-block>
1256 </fo:block>
1257</xsl:template>
1258
1259<xsl:template match="calloutlist/title">
1260</xsl:template>
1261
1262<xsl:template match="callout">
1263 <xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable>
1264
1265 <xsl:variable name="keep.together">
1266 <xsl:call-template name="pi.dbfo_keep-together"/>
1267 </xsl:variable>
1268
1269 <fo:list-item id="{$id}" xsl:use-attribute-sets="callout.properties">
1270 <xsl:if test="$keep.together != ''">
1271 <xsl:attribute name="keep-together.within-column"><xsl:value-of
1272 select="$keep.together"/></xsl:attribute>
1273 </xsl:if>
1274 <fo:list-item-label end-indent="label-end()">
1275 <fo:block>
1276 <xsl:call-template name="callout.arearefs">
1277 <xsl:with-param name="arearefs" select="@arearefs"/>
1278 </xsl:call-template>
1279 </fo:block>
1280 </fo:list-item-label>
1281 <fo:list-item-body start-indent="body-start()">
1282 <fo:block>
1283 <xsl:apply-templates/>
1284 </fo:block>
1285 </fo:list-item-body>
1286 </fo:list-item>
1287</xsl:template>
1288
1289<xsl:template name="callout.arearefs">
1290 <xsl:param name="arearefs"></xsl:param>
1291 <xsl:if test="$arearefs!=''">
1292 <xsl:choose>
1293 <xsl:when test="substring-before($arearefs,' ')=''">
1294 <xsl:call-template name="callout.arearef">
1295 <xsl:with-param name="arearef" select="$arearefs"/>
1296 </xsl:call-template>
1297 </xsl:when>
1298 <xsl:otherwise>
1299 <xsl:call-template name="callout.arearef">
1300 <xsl:with-param name="arearef"
1301 select="substring-before($arearefs,' ')"/>
1302 </xsl:call-template>
1303 </xsl:otherwise>
1304 </xsl:choose>
1305 <xsl:call-template name="callout.arearefs">
1306 <xsl:with-param name="arearefs"
1307 select="substring-after($arearefs,' ')"/>
1308 </xsl:call-template>
1309 </xsl:if>
1310</xsl:template>
1311
1312<xsl:template name="callout.arearef">
1313 <xsl:param name="arearef"></xsl:param>
1314 <xsl:variable name="targets" select="key('id',$arearef)"/>
1315 <xsl:variable name="target" select="$targets[1]"/>
1316
1317 <xsl:choose>
1318 <xsl:when test="count($target)=0">
1319 <xsl:value-of select="$arearef"/>
1320 <xsl:text>: ???</xsl:text>
1321 </xsl:when>
1322 <xsl:when test="local-name($target)='co'">
1323 <fo:basic-link internal-destination="{$arearef}">
1324 <xsl:apply-templates select="$target" mode="callout-bug"/>
1325 </fo:basic-link>
1326 </xsl:when>
1327 <xsl:when test="local-name($target)='areaset'">
1328 <xsl:call-template name="callout-bug">
1329 <xsl:with-param name="conum">
1330 <xsl:apply-templates select="$target" mode="conumber"/>
1331 </xsl:with-param>
1332 </xsl:call-template>
1333 </xsl:when>
1334 <xsl:when test="local-name($target)='area'">
1335 <xsl:choose>
1336 <xsl:when test="$target/parent::areaset">
1337 <xsl:call-template name="callout-bug">
1338 <xsl:with-param name="conum">
1339 <xsl:apply-templates select="$target/parent::areaset"
1340 mode="conumber"/>
1341 </xsl:with-param>
1342 </xsl:call-template>
1343 </xsl:when>
1344 <xsl:otherwise>
1345 <xsl:call-template name="callout-bug">
1346 <xsl:with-param name="conum">
1347 <xsl:apply-templates select="$target" mode="conumber"/>
1348 </xsl:with-param>
1349 </xsl:call-template>
1350 </xsl:otherwise>
1351 </xsl:choose>
1352 </xsl:when>
1353 <xsl:otherwise>
1354 <xsl:text>???</xsl:text>
1355 </xsl:otherwise>
1356 </xsl:choose>
1357</xsl:template>
1358
1359<!-- ==================================================================== -->
1360
1361<xsl:template name="orderedlist-starting-number">
1362 <xsl:param name="list" select="."/>
1363 <xsl:variable name="pi-start">
1364 <xsl:call-template name="pi.dbfo_start">
1365 <xsl:with-param name="node" select="$list"/>
1366 </xsl:call-template>
1367 </xsl:variable>
1368 <xsl:call-template name="output-orderedlist-starting-number">
1369 <xsl:with-param name="list" select="$list"/>
1370 <xsl:with-param name="pi-start" select="$pi-start"/>
1371 </xsl:call-template>
1372</xsl:template>
1373
1374</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.