source: stylesheets/lfs-xsl/docbook-xsl-1.78.1/fo/sections.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: 27.4 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 xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions"
5 version='1.0'>
6
7<!-- ********************************************************************
8 $Id: sections.xsl 9647 2012-10-26 17:42:03Z bobstayton $
9 ********************************************************************
10
11 This file is part of the XSL DocBook Stylesheet distribution.
12 See ../README or http://docbook.sf.net/release/xsl/current/ for
13 copyright and other information.
14
15 ******************************************************************** -->
16
17<!-- ==================================================================== -->
18
19<xsl:template match="section">
20 <xsl:choose>
21 <xsl:when test="$rootid = @id or $rootid = @xml:id">
22 <xsl:call-template name="section.page.sequence"/>
23 </xsl:when>
24 <xsl:otherwise>
25 <xsl:variable name="id">
26 <xsl:call-template name="object.id"/>
27 </xsl:variable>
28
29 <xsl:variable name="renderas">
30 <xsl:choose>
31 <xsl:when test="@renderas = 'sect1'">1</xsl:when>
32 <xsl:when test="@renderas = 'sect2'">2</xsl:when>
33 <xsl:when test="@renderas = 'sect3'">3</xsl:when>
34 <xsl:when test="@renderas = 'sect4'">4</xsl:when>
35 <xsl:when test="@renderas = 'sect5'">5</xsl:when>
36 <xsl:otherwise><xsl:value-of select="''"/></xsl:otherwise>
37 </xsl:choose>
38 </xsl:variable>
39
40 <xsl:variable name="level">
41 <xsl:choose>
42 <xsl:when test="$renderas != ''">
43 <xsl:value-of select="$renderas"/>
44 </xsl:when>
45 <xsl:otherwise>
46 <xsl:call-template name="section.level"/>
47 </xsl:otherwise>
48 </xsl:choose>
49 </xsl:variable>
50
51 <!-- xsl:use-attribute-sets takes only a Qname, not a variable -->
52 <xsl:choose>
53 <xsl:when test="$level = 1">
54 <xsl:element name="fo:{$section.container.element}"
55 use-attribute-sets="section.level1.properties">
56 <xsl:attribute name="id"><xsl:value-of
57 select="$id"/></xsl:attribute>
58 <xsl:call-template name="section.content"/>
59 </xsl:element>
60 </xsl:when>
61 <xsl:when test="$level = 2">
62 <xsl:element name="fo:{$section.container.element}"
63 use-attribute-sets="section.level2.properties">
64 <xsl:attribute name="id"><xsl:value-of
65 select="$id"/></xsl:attribute>
66 <xsl:call-template name="section.content"/>
67 </xsl:element>
68 </xsl:when>
69 <xsl:when test="$level = 3">
70 <xsl:element name="fo:{$section.container.element}"
71 use-attribute-sets="section.level3.properties">
72 <xsl:attribute name="id"><xsl:value-of
73 select="$id"/></xsl:attribute>
74 <xsl:call-template name="section.content"/>
75 </xsl:element>
76 </xsl:when>
77 <xsl:when test="$level = 4">
78 <xsl:element name="fo:{$section.container.element}"
79 use-attribute-sets="section.level4.properties">
80 <xsl:attribute name="id"><xsl:value-of
81 select="$id"/></xsl:attribute>
82 <xsl:call-template name="section.content"/>
83 </xsl:element>
84 </xsl:when>
85 <xsl:when test="$level = 5">
86 <xsl:element name="fo:{$section.container.element}"
87 use-attribute-sets="section.level5.properties">
88 <xsl:attribute name="id"><xsl:value-of
89 select="$id"/></xsl:attribute>
90 <xsl:call-template name="section.content"/>
91 </xsl:element>
92 </xsl:when>
93 <xsl:otherwise>
94 <xsl:element name="fo:{$section.container.element}"
95 use-attribute-sets="section.level6.properties">
96 <xsl:attribute name="id"><xsl:value-of
97 select="$id"/></xsl:attribute>
98 <xsl:call-template name="section.content"/>
99 </xsl:element>
100 </xsl:otherwise>
101 </xsl:choose>
102 </xsl:otherwise>
103 </xsl:choose>
104</xsl:template>
105
106<xsl:template name="section.content">
107 <xsl:call-template name="section.titlepage"/>
108
109 <xsl:variable name="toc.params">
110 <xsl:call-template name="find.path.params">
111 <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
112 </xsl:call-template>
113 </xsl:variable>
114
115 <xsl:if test="contains($toc.params, 'toc')
116 and (count(ancestor::section)+1) &lt;=
117 $generate.section.toc.level">
118 <xsl:call-template name="section.toc">
119 <xsl:with-param name="toc.title.p"
120 select="contains($toc.params, 'title')"/>
121 </xsl:call-template>
122 <xsl:call-template name="section.toc.separator"/>
123 </xsl:if>
124
125 <xsl:apply-templates/>
126</xsl:template>
127
128<xsl:template match="/section" name="section.page.sequence">
129 <xsl:variable name="id">
130 <xsl:call-template name="object.id"/>
131 </xsl:variable>
132
133 <xsl:variable name="master-reference">
134 <xsl:call-template name="select.pagemaster"/>
135 </xsl:variable>
136
137 <fo:page-sequence hyphenate="{$hyphenate}"
138 master-reference="{$master-reference}">
139 <xsl:attribute name="language">
140 <xsl:call-template name="l10n.language"/>
141 </xsl:attribute>
142 <xsl:attribute name="format">
143 <xsl:call-template name="page.number.format">
144 <xsl:with-param name="master-reference" select="$master-reference"/>
145 </xsl:call-template>
146 </xsl:attribute>
147
148 <xsl:attribute name="initial-page-number">
149 <xsl:call-template name="initial.page.number">
150 <xsl:with-param name="master-reference" select="$master-reference"/>
151 </xsl:call-template>
152 </xsl:attribute>
153
154 <xsl:attribute name="force-page-count">
155 <xsl:call-template name="force.page.count">
156 <xsl:with-param name="master-reference" select="$master-reference"/>
157 </xsl:call-template>
158 </xsl:attribute>
159
160 <xsl:attribute name="hyphenation-character">
161 <xsl:call-template name="gentext">
162 <xsl:with-param name="key" select="'hyphenation-character'"/>
163 </xsl:call-template>
164 </xsl:attribute>
165 <xsl:attribute name="hyphenation-push-character-count">
166 <xsl:call-template name="gentext">
167 <xsl:with-param name="key" select="'hyphenation-push-character-count'"/>
168 </xsl:call-template>
169 </xsl:attribute>
170 <xsl:attribute name="hyphenation-remain-character-count">
171 <xsl:call-template name="gentext">
172 <xsl:with-param name="key" select="'hyphenation-remain-character-count'"/>
173 </xsl:call-template>
174 </xsl:attribute>
175
176 <xsl:apply-templates select="." mode="running.head.mode">
177 <xsl:with-param name="master-reference" select="$master-reference"/>
178 </xsl:apply-templates>
179 <xsl:apply-templates select="." mode="running.foot.mode">
180 <xsl:with-param name="master-reference" select="$master-reference"/>
181 </xsl:apply-templates>
182
183 <fo:flow flow-name="xsl-region-body">
184 <xsl:call-template name="set.flow.properties">
185 <xsl:with-param name="element" select="local-name(.)"/>
186 <xsl:with-param name="master-reference" select="$master-reference"/>
187 </xsl:call-template>
188
189 <fo:block id="{$id}"
190 xsl:use-attribute-sets="section.level1.properties">
191 <xsl:call-template name="section.titlepage"/>
192 </fo:block>
193
194 <xsl:variable name="toc.params">
195 <xsl:call-template name="find.path.params">
196 <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
197 </xsl:call-template>
198 </xsl:variable>
199
200 <xsl:if test="contains($toc.params, 'toc')
201 and (count(ancestor::section)+1) &lt;=
202 $generate.section.toc.level">
203 <xsl:call-template name="section.toc">
204 <xsl:with-param name="toc.title.p"
205 select="contains($toc.params, 'title')"/>
206 </xsl:call-template>
207 <xsl:call-template name="section.toc.separator"/>
208 </xsl:if>
209
210 <xsl:apply-templates/>
211 </fo:flow>
212 </fo:page-sequence>
213</xsl:template>
214
215<xsl:template match="section/title
216 |simplesect/title
217 |sect1/title
218 |sect2/title
219 |sect3/title
220 |sect4/title
221 |sect5/title
222 |section/info/title
223 |simplesect/info/title
224 |sect1/info/title
225 |sect2/info/title
226 |sect3/info/title
227 |sect4/info/title
228 |sect5/info/title
229 |section/sectioninfo/title
230 |sect1/sect1info/title
231 |sect2/sect2info/title
232 |sect3/sect3info/title
233 |sect4/sect4info/title
234 |sect5/sect5info/title"
235 mode="titlepage.mode"
236 priority="2">
237
238 <xsl:variable name="section"
239 select="(ancestor::section |
240 ancestor::simplesect |
241 ancestor::sect1 |
242 ancestor::sect2 |
243 ancestor::sect3 |
244 ancestor::sect4 |
245 ancestor::sect5)[position() = last()]"/>
246
247 <fo:block keep-with-next.within-column="always">
248 <xsl:variable name="id">
249 <xsl:call-template name="object.id">
250 <xsl:with-param name="object" select="$section"/>
251 </xsl:call-template>
252 </xsl:variable>
253
254 <xsl:variable name="renderas">
255 <xsl:choose>
256 <xsl:when test="$section/@renderas = 'sect1'">1</xsl:when>
257 <xsl:when test="$section/@renderas = 'sect2'">2</xsl:when>
258 <xsl:when test="$section/@renderas = 'sect3'">3</xsl:when>
259 <xsl:when test="$section/@renderas = 'sect4'">4</xsl:when>
260 <xsl:when test="$section/@renderas = 'sect5'">5</xsl:when>
261 <xsl:otherwise><xsl:value-of select="''"/></xsl:otherwise>
262 </xsl:choose>
263 </xsl:variable>
264
265 <xsl:variable name="level">
266 <xsl:choose>
267 <xsl:when test="$renderas != ''">
268 <xsl:value-of select="$renderas"/>
269 </xsl:when>
270 <xsl:otherwise>
271 <xsl:call-template name="section.level">
272 <xsl:with-param name="node" select="$section"/>
273 </xsl:call-template>
274 </xsl:otherwise>
275 </xsl:choose>
276 </xsl:variable>
277
278 <xsl:variable name="marker">
279 <xsl:choose>
280 <xsl:when test="$level &lt;= $marker.section.level">1</xsl:when>
281 <xsl:otherwise>0</xsl:otherwise>
282 </xsl:choose>
283 </xsl:variable>
284
285 <xsl:variable name="title">
286 <xsl:apply-templates select="$section" mode="object.title.markup">
287 <xsl:with-param name="allow-anchors" select="1"/>
288 </xsl:apply-templates>
289 </xsl:variable>
290
291 <xsl:variable name="marker.title">
292 <xsl:apply-templates select="$section" mode="titleabbrev.markup">
293 <xsl:with-param name="allow-anchors" select="0"/>
294 </xsl:apply-templates>
295 </xsl:variable>
296
297 <xsl:if test="$axf.extensions != 0">
298 <xsl:attribute name="axf:outline-level">
299 <xsl:value-of select="count(ancestor::*)-1"/>
300 </xsl:attribute>
301 <xsl:attribute name="axf:outline-expand">false</xsl:attribute>
302 <xsl:attribute name="axf:outline-title">
303 <xsl:value-of select="normalize-space($title)"/>
304 </xsl:attribute>
305 </xsl:if>
306
307 <xsl:call-template name="section.heading">
308 <xsl:with-param name="level" select="$level"/>
309 <xsl:with-param name="title" select="$title"/>
310 <xsl:with-param name="marker" select="$marker"/>
311 <xsl:with-param name="marker.title" select="$marker.title"/>
312 </xsl:call-template>
313 </fo:block>
314</xsl:template>
315
316<xsl:template match="sect1">
317 <xsl:variable name="id">
318 <xsl:call-template name="object.id"/>
319 </xsl:variable>
320
321 <xsl:element name="fo:{$section.container.element}"
322 use-attribute-sets="section.level1.properties">
323 <xsl:attribute name="id"><xsl:value-of
324 select="$id"/></xsl:attribute>
325 <xsl:call-template name="sect1.titlepage"/>
326
327 <xsl:variable name="toc.params">
328 <xsl:call-template name="find.path.params">
329 <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
330 </xsl:call-template>
331 </xsl:variable>
332
333 <xsl:if test="contains($toc.params, 'toc')
334 and $generate.section.toc.level &gt;= 1">
335 <xsl:call-template name="section.toc">
336 <xsl:with-param name="toc.title.p"
337 select="contains($toc.params, 'title')"/>
338 </xsl:call-template>
339 <xsl:call-template name="section.toc.separator"/>
340 </xsl:if>
341
342 <xsl:apply-templates/>
343 </xsl:element>
344</xsl:template>
345
346<xsl:template match="/sect1">
347 <xsl:variable name="id">
348 <xsl:call-template name="object.id"/>
349 </xsl:variable>
350 <xsl:variable name="master-reference">
351 <xsl:call-template name="select.pagemaster"/>
352 </xsl:variable>
353
354 <fo:page-sequence hyphenate="{$hyphenate}"
355 master-reference="{$master-reference}">
356 <xsl:attribute name="language">
357 <xsl:call-template name="l10n.language"/>
358 </xsl:attribute>
359 <xsl:attribute name="format">
360 <xsl:call-template name="page.number.format">
361 <xsl:with-param name="master-reference" select="$master-reference"/>
362 </xsl:call-template>
363 </xsl:attribute>
364
365 <xsl:attribute name="initial-page-number">
366 <xsl:call-template name="initial.page.number">
367 <xsl:with-param name="master-reference" select="$master-reference"/>
368 </xsl:call-template>
369 </xsl:attribute>
370
371 <xsl:attribute name="force-page-count">
372 <xsl:call-template name="force.page.count">
373 <xsl:with-param name="master-reference" select="$master-reference"/>
374 </xsl:call-template>
375 </xsl:attribute>
376
377 <xsl:attribute name="hyphenation-character">
378 <xsl:call-template name="gentext">
379 <xsl:with-param name="key" select="'hyphenation-character'"/>
380 </xsl:call-template>
381 </xsl:attribute>
382 <xsl:attribute name="hyphenation-push-character-count">
383 <xsl:call-template name="gentext">
384 <xsl:with-param name="key" select="'hyphenation-push-character-count'"/>
385 </xsl:call-template>
386 </xsl:attribute>
387 <xsl:attribute name="hyphenation-remain-character-count">
388 <xsl:call-template name="gentext">
389 <xsl:with-param name="key" select="'hyphenation-remain-character-count'"/>
390 </xsl:call-template>
391 </xsl:attribute>
392
393 <xsl:apply-templates select="." mode="running.head.mode">
394 <xsl:with-param name="master-reference" select="$master-reference"/>
395 </xsl:apply-templates>
396 <xsl:apply-templates select="." mode="running.foot.mode">
397 <xsl:with-param name="master-reference" select="$master-reference"/>
398 </xsl:apply-templates>
399
400 <fo:flow flow-name="xsl-region-body">
401 <xsl:call-template name="set.flow.properties">
402 <xsl:with-param name="element" select="local-name(.)"/>
403 <xsl:with-param name="master-reference" select="$master-reference"/>
404 </xsl:call-template>
405
406 <fo:block id="{$id}"
407 xsl:use-attribute-sets="section.level1.properties">
408 <xsl:call-template name="sect1.titlepage"/>
409 </fo:block>
410
411 <xsl:variable name="toc.params">
412 <xsl:call-template name="find.path.params">
413 <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
414 </xsl:call-template>
415 </xsl:variable>
416
417 <xsl:if test="contains($toc.params, 'toc')
418 and $generate.section.toc.level &gt;= 1">
419 <xsl:call-template name="section.toc">
420 <xsl:with-param name="toc.title.p"
421 select="contains($toc.params, 'title')"/>
422 </xsl:call-template>
423 <xsl:call-template name="section.toc.separator"/>
424 </xsl:if>
425
426 <xsl:apply-templates/>
427 </fo:flow>
428 </fo:page-sequence>
429</xsl:template>
430
431<xsl:template match="sect2">
432 <xsl:variable name="id">
433 <xsl:call-template name="object.id"/>
434 </xsl:variable>
435
436 <xsl:element name="fo:{$section.container.element}"
437 use-attribute-sets="section.level2.properties">
438 <xsl:attribute name="id"><xsl:value-of
439 select="$id"/></xsl:attribute>
440 <xsl:call-template name="sect2.titlepage"/>
441
442 <xsl:variable name="toc.params">
443 <xsl:call-template name="find.path.params">
444 <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
445 </xsl:call-template>
446 </xsl:variable>
447
448 <xsl:if test="contains($toc.params, 'toc')
449 and $generate.section.toc.level &gt;= 2">
450 <xsl:call-template name="section.toc">
451 <xsl:with-param name="toc.title.p"
452 select="contains($toc.params, 'title')"/>
453 </xsl:call-template>
454 <xsl:call-template name="section.toc.separator"/>
455 </xsl:if>
456
457 <xsl:apply-templates/>
458 </xsl:element>
459</xsl:template>
460
461<xsl:template match="sect3">
462 <xsl:variable name="id">
463 <xsl:call-template name="object.id"/>
464 </xsl:variable>
465
466 <xsl:element name="fo:{$section.container.element}"
467 use-attribute-sets="section.level3.properties">
468 <xsl:attribute name="id"><xsl:value-of
469 select="$id"/></xsl:attribute>
470 <xsl:call-template name="sect3.titlepage"/>
471
472 <xsl:variable name="toc.params">
473 <xsl:call-template name="find.path.params">
474 <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
475 </xsl:call-template>
476 </xsl:variable>
477
478 <xsl:if test="contains($toc.params, 'toc')
479 and $generate.section.toc.level &gt;= 3">
480 <xsl:call-template name="section.toc">
481 <xsl:with-param name="toc.title.p"
482 select="contains($toc.params, 'title')"/>
483 </xsl:call-template>
484 <xsl:call-template name="section.toc.separator"/>
485 </xsl:if>
486
487 <xsl:apply-templates/>
488 </xsl:element>
489</xsl:template>
490
491<xsl:template match="sect4">
492 <xsl:variable name="id">
493 <xsl:call-template name="object.id"/>
494 </xsl:variable>
495
496 <xsl:element name="fo:{$section.container.element}"
497 use-attribute-sets="section.level4.properties">
498 <xsl:attribute name="id"><xsl:value-of
499 select="$id"/></xsl:attribute>
500 <xsl:call-template name="sect4.titlepage"/>
501
502 <xsl:variable name="toc.params">
503 <xsl:call-template name="find.path.params">
504 <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
505 </xsl:call-template>
506 </xsl:variable>
507
508 <xsl:if test="contains($toc.params, 'toc')
509 and $generate.section.toc.level &gt;= 4">
510 <xsl:call-template name="section.toc">
511 <xsl:with-param name="toc.title.p"
512 select="contains($toc.params, 'title')"/>
513 </xsl:call-template>
514 <xsl:call-template name="section.toc.separator"/>
515 </xsl:if>
516
517 <xsl:apply-templates/>
518 </xsl:element>
519</xsl:template>
520
521<xsl:template match="sect5">
522 <xsl:variable name="id">
523 <xsl:call-template name="object.id"/>
524 </xsl:variable>
525
526 <xsl:element name="fo:{$section.container.element}"
527 use-attribute-sets="section.level5.properties">
528 <xsl:attribute name="id"><xsl:value-of
529 select="$id"/></xsl:attribute>
530 <xsl:call-template name="sect5.titlepage"/>
531
532 <xsl:variable name="toc.params">
533 <xsl:call-template name="find.path.params">
534 <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
535 </xsl:call-template>
536 </xsl:variable>
537
538 <xsl:if test="contains($toc.params, 'toc')
539 and $generate.section.toc.level &gt;= 5">
540 <xsl:call-template name="section.toc">
541 <xsl:with-param name="toc.title.p"
542 select="contains($toc.params, 'title')"/>
543 </xsl:call-template>
544 <xsl:call-template name="section.toc.separator"/>
545 </xsl:if>
546
547 <xsl:apply-templates/>
548 </xsl:element>
549</xsl:template>
550
551<xsl:template match="simplesect">
552 <xsl:variable name="id">
553 <xsl:call-template name="object.id"/>
554 </xsl:variable>
555
556 <xsl:element name="fo:{$section.container.element}">
557 <xsl:attribute name="id"><xsl:value-of
558 select="$id"/></xsl:attribute>
559 <xsl:call-template name="simplesect.titlepage"/>
560 <xsl:apply-templates/>
561 </xsl:element>
562</xsl:template>
563
564<xsl:template match="sectioninfo"></xsl:template>
565<xsl:template match="section/info"></xsl:template>
566<xsl:template match="section/title"></xsl:template>
567<xsl:template match="section/titleabbrev"></xsl:template>
568<xsl:template match="section/subtitle"></xsl:template>
569
570<xsl:template match="sect1info"></xsl:template>
571<xsl:template match="sect1/info"></xsl:template>
572<xsl:template match="sect1/title"></xsl:template>
573<xsl:template match="sect1/titleabbrev"></xsl:template>
574<xsl:template match="sect1/subtitle"></xsl:template>
575
576<xsl:template match="sect2info"></xsl:template>
577<xsl:template match="sect2/info"></xsl:template>
578<xsl:template match="sect2/title"></xsl:template>
579<xsl:template match="sect2/titleabbrev"></xsl:template>
580<xsl:template match="sect2/subtitle"></xsl:template>
581
582<xsl:template match="sect3info"></xsl:template>
583<xsl:template match="sect3/info"></xsl:template>
584<xsl:template match="sect3/title"></xsl:template>
585<xsl:template match="sect3/titleabbrev"></xsl:template>
586<xsl:template match="sect3/subtitle"></xsl:template>
587
588<xsl:template match="sect4info"></xsl:template>
589<xsl:template match="sect4/info"></xsl:template>
590<xsl:template match="sect4/title"></xsl:template>
591<xsl:template match="sect4/titleabbrev"></xsl:template>
592<xsl:template match="sect4/subtitle"></xsl:template>
593
594<xsl:template match="sect5info"></xsl:template>
595<xsl:template match="sect5/info"></xsl:template>
596<xsl:template match="sect5/title"></xsl:template>
597<xsl:template match="sect5/titleabbrev"></xsl:template>
598<xsl:template match="sect5/subtitle"></xsl:template>
599
600<xsl:template match="simplesect/info"></xsl:template>
601<xsl:template match="simplesect/title"></xsl:template>
602<xsl:template match="simplesect/titleabbrev"></xsl:template>
603<xsl:template match="simplesect/subtitle"></xsl:template>
604
605<!-- ==================================================================== -->
606
607<xsl:template name="section.heading">
608 <xsl:param name="level" select="1"/>
609 <xsl:param name="marker" select="1"/>
610 <xsl:param name="title"/>
611 <xsl:param name="marker.title"/>
612
613 <fo:block xsl:use-attribute-sets="section.title.properties">
614 <xsl:if test="$marker != 0">
615 <fo:marker marker-class-name="section.head.marker">
616 <xsl:copy-of select="$marker.title"/>
617 </fo:marker>
618 </xsl:if>
619
620 <xsl:choose>
621 <xsl:when test="$level=1">
622 <fo:block xsl:use-attribute-sets="section.title.level1.properties">
623 <xsl:copy-of select="$title"/>
624 </fo:block>
625 </xsl:when>
626 <xsl:when test="$level=2">
627 <fo:block xsl:use-attribute-sets="section.title.level2.properties">
628 <xsl:copy-of select="$title"/>
629 </fo:block>
630 </xsl:when>
631 <xsl:when test="$level=3">
632 <fo:block xsl:use-attribute-sets="section.title.level3.properties">
633 <xsl:copy-of select="$title"/>
634 </fo:block>
635 </xsl:when>
636 <xsl:when test="$level=4">
637 <fo:block xsl:use-attribute-sets="section.title.level4.properties">
638 <xsl:copy-of select="$title"/>
639 </fo:block>
640 </xsl:when>
641 <xsl:when test="$level=5">
642 <fo:block xsl:use-attribute-sets="section.title.level5.properties">
643 <xsl:copy-of select="$title"/>
644 </fo:block>
645 </xsl:when>
646 <xsl:otherwise>
647 <fo:block xsl:use-attribute-sets="section.title.level6.properties">
648 <xsl:copy-of select="$title"/>
649 </fo:block>
650 </xsl:otherwise>
651 </xsl:choose>
652 </fo:block>
653</xsl:template>
654
655<!-- ==================================================================== -->
656
657<xsl:template match="bridgehead">
658 <xsl:variable name="container"
659 select="(ancestor::appendix
660 |ancestor::article
661 |ancestor::bibliography
662 |ancestor::chapter
663 |ancestor::glossary
664 |ancestor::glossdiv
665 |ancestor::index
666 |ancestor::partintro
667 |ancestor::preface
668 |ancestor::refsect1
669 |ancestor::refsect2
670 |ancestor::refsect3
671 |ancestor::sect1
672 |ancestor::sect2
673 |ancestor::sect3
674 |ancestor::sect4
675 |ancestor::sect5
676 |ancestor::section
677 |ancestor::setindex
678 |ancestor::simplesect)[last()]"/>
679
680 <xsl:variable name="clevel">
681 <xsl:choose>
682 <xsl:when test="local-name($container) = 'appendix'
683 or local-name($container) = 'chapter'
684 or local-name($container) = 'article'
685 or local-name($container) = 'bibliography'
686 or local-name($container) = 'glossary'
687 or local-name($container) = 'index'
688 or local-name($container) = 'partintro'
689 or local-name($container) = 'preface'
690 or local-name($container) = 'setindex'">2</xsl:when>
691 <xsl:when test="local-name($container) = 'glossdiv'">
692 <xsl:value-of select="count(ancestor::glossdiv)+2"/>
693 </xsl:when>
694 <xsl:when test="local-name($container) = 'sect1'
695 or local-name($container) = 'sect2'
696 or local-name($container) = 'sect3'
697 or local-name($container) = 'sect4'
698 or local-name($container) = 'sect5'
699 or local-name($container) = 'refsect1'
700 or local-name($container) = 'refsect2'
701 or local-name($container) = 'refsect3'
702 or local-name($container) = 'section'
703 or local-name($container) = 'simplesect'">
704 <xsl:variable name="slevel">
705 <xsl:call-template name="section.level">
706 <xsl:with-param name="node" select="$container"/>
707 </xsl:call-template>
708 </xsl:variable>
709 <xsl:value-of select="$slevel + 1"/>
710 </xsl:when>
711 <xsl:otherwise>2</xsl:otherwise>
712 </xsl:choose>
713 </xsl:variable>
714
715 <xsl:variable name="level">
716 <xsl:choose>
717 <xsl:when test="@renderas = 'sect1'">1</xsl:when>
718 <xsl:when test="@renderas = 'sect2'">2</xsl:when>
719 <xsl:when test="@renderas = 'sect3'">3</xsl:when>
720 <xsl:when test="@renderas = 'sect4'">4</xsl:when>
721 <xsl:when test="@renderas = 'sect5'">5</xsl:when>
722 <xsl:otherwise>
723 <xsl:value-of select="$clevel"/>
724 </xsl:otherwise>
725 </xsl:choose>
726 </xsl:variable>
727
728 <xsl:variable name="marker">
729 <xsl:choose>
730 <xsl:when test="$level &lt;= $marker.section.level">1</xsl:when>
731 <xsl:otherwise>0</xsl:otherwise>
732 </xsl:choose>
733 </xsl:variable>
734
735 <xsl:variable name="marker.title">
736 <xsl:apply-templates/>
737 </xsl:variable>
738
739 <xsl:variable name="id">
740 <xsl:call-template name="object.id"/>
741 </xsl:variable>
742
743 <fo:block id="{$id}">
744 <xsl:call-template name="section.heading">
745 <xsl:with-param name="level" select="$level"/>
746 <xsl:with-param name="title">
747 <xsl:apply-templates/>
748 </xsl:with-param>
749 <xsl:with-param name="marker" select="$marker"/>
750 <xsl:with-param name="marker.title" select="$marker.title"/>
751 </xsl:call-template>
752 </fo:block>
753</xsl:template>
754
755</xsl:stylesheet>
756
Note: See TracBrowser for help on using the repository browser.