]> git.evergreen-ils.org Git - working/Evergreen.git/blob - stylesheets/evergreen_docbook_files/docbook-xsl-1.75.2/fo/component.xsl
Evergreen Version Fix to reflect the new EG releases 2.0.10 and 1.6.1.9
[working/Evergreen.git] / stylesheets / evergreen_docbook_files / docbook-xsl-1.75.2 / fo / component.xsl
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: component.xsl 8320 2009-03-12 17:43:44Z mzjn $
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
20 <xsl:template name="component.title">
21   <xsl:param name="node" select="."/>
22   <xsl:param name="pagewide" select="0"/>
23
24   <xsl:variable name="id">
25     <xsl:call-template name="object.id">
26       <xsl:with-param name="object" select="$node"/>
27     </xsl:call-template>
28   </xsl:variable>
29
30   <xsl:variable name="title">
31     <xsl:apply-templates select="$node" mode="object.title.markup">
32       <xsl:with-param name="allow-anchors" select="1"/>
33     </xsl:apply-templates>
34   </xsl:variable>
35
36   <xsl:variable name="titleabbrev">
37     <xsl:apply-templates select="$node" mode="titleabbrev.markup"/>
38   </xsl:variable>
39
40   <xsl:variable name="level">
41     <xsl:choose>
42       <xsl:when test="ancestor::section">
43         <xsl:value-of select="count(ancestor::section)+1"/>
44       </xsl:when>
45       <xsl:when test="ancestor::sect5">6</xsl:when>
46       <xsl:when test="ancestor::sect4">5</xsl:when>
47       <xsl:when test="ancestor::sect3">4</xsl:when>
48       <xsl:when test="ancestor::sect2">3</xsl:when>
49       <xsl:when test="ancestor::sect1">2</xsl:when>
50       <xsl:otherwise>1</xsl:otherwise>
51     </xsl:choose>
52   </xsl:variable>
53
54   <xsl:if test="$passivetex.extensions != 0">
55     <fotex:bookmark xmlns:fotex="http://www.tug.org/fotex"
56                     fotex-bookmark-level="2"
57                     fotex-bookmark-label="{$id}">
58       <xsl:value-of select="$titleabbrev"/>
59     </fotex:bookmark>
60   </xsl:if>
61
62   <fo:block xsl:use-attribute-sets="component.title.properties">
63     <xsl:if test="$pagewide != 0">
64       <!-- Doesn't work to use 'all' here since not a child of fo:flow -->
65       <xsl:attribute name="span">inherit</xsl:attribute>
66     </xsl:if>
67     <xsl:attribute name="hyphenation-character">
68       <xsl:call-template name="gentext">
69         <xsl:with-param name="key" select="'hyphenation-character'"/>
70       </xsl:call-template>
71     </xsl:attribute>
72     <xsl:attribute name="hyphenation-push-character-count">
73       <xsl:call-template name="gentext">
74         <xsl:with-param name="key" select="'hyphenation-push-character-count'"/>
75       </xsl:call-template>
76     </xsl:attribute>
77     <xsl:attribute name="hyphenation-remain-character-count">
78       <xsl:call-template name="gentext">
79         <xsl:with-param name="key" select="'hyphenation-remain-character-count'"/>
80       </xsl:call-template>
81     </xsl:attribute>
82     <xsl:if test="$axf.extensions != 0">
83       <xsl:attribute name="axf:outline-level">
84         <xsl:value-of select="count($node/ancestor::*)"/>
85       </xsl:attribute>
86       <xsl:attribute name="axf:outline-expand">false</xsl:attribute>
87       <xsl:attribute name="axf:outline-title">
88         <xsl:value-of select="normalize-space($title)"/>
89       </xsl:attribute>
90     </xsl:if>
91
92     <!-- Let's handle the case where a component (bibliography, for example)
93          occurs inside a section; will we need parameters for this?
94          Danger Will Robinson: using section.title.level*.properties here
95          runs the risk that someone will set something other than
96          font-size there... -->
97     <xsl:choose>
98       <xsl:when test="$level=2">
99         <fo:block xsl:use-attribute-sets="section.title.level2.properties">
100           <xsl:copy-of select="$title"/>
101         </fo:block>
102       </xsl:when>
103       <xsl:when test="$level=3">
104         <fo:block xsl:use-attribute-sets="section.title.level3.properties">
105           <xsl:copy-of select="$title"/>
106         </fo:block>
107       </xsl:when>
108       <xsl:when test="$level=4">
109         <fo:block xsl:use-attribute-sets="section.title.level4.properties">
110           <xsl:copy-of select="$title"/>
111         </fo:block>
112       </xsl:when>
113       <xsl:when test="$level=5">
114         <fo:block xsl:use-attribute-sets="section.title.level5.properties">
115           <xsl:copy-of select="$title"/>
116         </fo:block>
117       </xsl:when>
118       <xsl:when test="$level=6">
119         <fo:block xsl:use-attribute-sets="section.title.level6.properties">
120           <xsl:copy-of select="$title"/>
121         </fo:block>
122       </xsl:when>
123       <xsl:otherwise>
124         <!-- not in a section: do nothing special -->
125         <xsl:copy-of select="$title"/>
126       </xsl:otherwise>
127     </xsl:choose>
128   </fo:block>
129 </xsl:template>
130
131 <!-- ==================================================================== -->
132
133 <xsl:template match="dedication" mode="dedication">
134   <xsl:variable name="id">
135     <xsl:call-template name="object.id"/>
136   </xsl:variable>
137
138   <xsl:variable name="master-reference">
139     <xsl:call-template name="select.pagemaster"/>
140   </xsl:variable>
141
142   <fo:page-sequence hyphenate="{$hyphenate}"
143                     master-reference="{$master-reference}">
144     <xsl:attribute name="language">
145       <xsl:call-template name="l10n.language"/>
146     </xsl:attribute>
147     <xsl:attribute name="format">
148       <xsl:call-template name="page.number.format">
149         <xsl:with-param name="master-reference" select="$master-reference"/>
150       </xsl:call-template>
151     </xsl:attribute>
152
153     <xsl:attribute name="initial-page-number">
154       <xsl:call-template name="initial.page.number">
155         <xsl:with-param name="master-reference" select="$master-reference"/>
156       </xsl:call-template>
157     </xsl:attribute>
158
159     <xsl:attribute name="force-page-count">
160       <xsl:call-template name="force.page.count">
161         <xsl:with-param name="master-reference" select="$master-reference"/>
162       </xsl:call-template>
163     </xsl:attribute>
164
165     <xsl:attribute name="hyphenation-character">
166       <xsl:call-template name="gentext">
167         <xsl:with-param name="key" select="'hyphenation-character'"/>
168       </xsl:call-template>
169     </xsl:attribute>
170     <xsl:attribute name="hyphenation-push-character-count">
171       <xsl:call-template name="gentext">
172         <xsl:with-param name="key" select="'hyphenation-push-character-count'"/>
173       </xsl:call-template>
174     </xsl:attribute>
175     <xsl:attribute name="hyphenation-remain-character-count">
176       <xsl:call-template name="gentext">
177         <xsl:with-param name="key" select="'hyphenation-remain-character-count'"/>
178       </xsl:call-template>
179     </xsl:attribute>
180
181     <xsl:apply-templates select="." mode="running.head.mode">
182       <xsl:with-param name="master-reference" select="$master-reference"/>
183     </xsl:apply-templates>
184
185     <xsl:apply-templates select="." mode="running.foot.mode">
186       <xsl:with-param name="master-reference" select="$master-reference"/>
187     </xsl:apply-templates>
188
189     <fo:flow flow-name="xsl-region-body">
190       <xsl:call-template name="set.flow.properties">
191         <xsl:with-param name="element" select="local-name(.)"/>
192         <xsl:with-param name="master-reference" select="$master-reference"/>
193       </xsl:call-template>
194
195       <fo:block id="{$id}"
196                 xsl:use-attribute-sets="component.titlepage.properties">
197         <xsl:call-template name="dedication.titlepage"/>
198       </fo:block>
199       <xsl:apply-templates/>
200     </fo:flow>
201   </fo:page-sequence>
202 </xsl:template>
203
204 <xsl:template match="dedication"></xsl:template> <!-- see mode="dedication" -->
205 <xsl:template match="dedication/docinfo"></xsl:template>
206 <xsl:template match="dedication/title"></xsl:template>
207 <xsl:template match="dedication/subtitle"></xsl:template>
208 <xsl:template match="dedication/titleabbrev"></xsl:template>
209
210 <!-- ==================================================================== -->
211
212 <xsl:template match="acknowledgements" mode="acknowledgements">
213   <xsl:variable name="id">
214     <xsl:call-template name="object.id"/>
215   </xsl:variable>
216
217   <xsl:variable name="master-reference">
218     <xsl:call-template name="select.pagemaster"/>
219   </xsl:variable>
220
221   <fo:page-sequence hyphenate="{$hyphenate}"
222                     master-reference="{$master-reference}">
223     <xsl:attribute name="language">
224       <xsl:call-template name="l10n.language"/>
225     </xsl:attribute>
226     <xsl:attribute name="format">
227       <xsl:call-template name="page.number.format">
228         <xsl:with-param name="master-reference" select="$master-reference"/>
229       </xsl:call-template>
230     </xsl:attribute>
231     <xsl:attribute name="initial-page-number">
232       <xsl:call-template name="initial.page.number">
233         <xsl:with-param name="master-reference" select="$master-reference"/>
234       </xsl:call-template>
235     </xsl:attribute>
236     <xsl:attribute name="force-page-count">
237       <xsl:call-template name="force.page.count">
238         <xsl:with-param name="master-reference" select="$master-reference"/>
239       </xsl:call-template>
240     </xsl:attribute>
241     <xsl:attribute name="hyphenation-character">
242       <xsl:call-template name="gentext">
243         <xsl:with-param name="key" select="'hyphenation-character'"/>
244       </xsl:call-template>
245     </xsl:attribute>
246     <xsl:attribute name="hyphenation-push-character-count">
247       <xsl:call-template name="gentext">
248         <xsl:with-param name="key" select="'hyphenation-push-character-count'"/>
249       </xsl:call-template>
250     </xsl:attribute>
251     <xsl:attribute name="hyphenation-remain-character-count">
252       <xsl:call-template name="gentext">
253         <xsl:with-param name="key" select="'hyphenation-remain-character-count'"/>
254       </xsl:call-template>
255     </xsl:attribute>
256
257     <xsl:apply-templates select="." mode="running.head.mode">
258       <xsl:with-param name="master-reference" select="$master-reference"/>
259     </xsl:apply-templates>
260
261     <xsl:apply-templates select="." mode="running.foot.mode">
262       <xsl:with-param name="master-reference" select="$master-reference"/>
263     </xsl:apply-templates>
264
265     <fo:flow flow-name="xsl-region-body">
266       <xsl:call-template name="set.flow.properties">
267         <xsl:with-param name="element" select="local-name(.)"/>
268         <xsl:with-param name="master-reference" select="$master-reference"/>
269       </xsl:call-template>
270
271       <fo:block id="{$id}"
272                 xsl:use-attribute-sets="component.titlepage.properties">
273         <xsl:call-template name="acknowledgements.titlepage"/>
274       </fo:block>
275       <xsl:apply-templates/>
276     </fo:flow>
277   </fo:page-sequence>
278 </xsl:template>
279
280 <xsl:template match="acknowledgements"></xsl:template>
281 <xsl:template match="acknowledgements/info"></xsl:template>
282 <xsl:template match="acknowledgements/title"></xsl:template>
283 <xsl:template match="acknowledgements/titleabbrev"></xsl:template>
284 <xsl:template match="acknowledgements/subtitle"></xsl:template>
285
286 <!-- ==================================================================== -->
287
288 <xsl:template match="colophon">
289   <xsl:variable name="id">
290     <xsl:call-template name="object.id"/>
291   </xsl:variable>
292
293   <xsl:variable name="master-reference">
294     <xsl:call-template name="select.pagemaster"/>
295   </xsl:variable>
296
297   <fo:page-sequence hyphenate="{$hyphenate}"
298                     master-reference="{$master-reference}">
299     <xsl:attribute name="language">
300       <xsl:call-template name="l10n.language"/>
301     </xsl:attribute>
302     <xsl:attribute name="format">
303       <xsl:call-template name="page.number.format">
304         <xsl:with-param name="master-reference" select="$master-reference"/>
305       </xsl:call-template>
306     </xsl:attribute>
307     <xsl:attribute name="initial-page-number">
308       <xsl:call-template name="initial.page.number">
309         <xsl:with-param name="master-reference" select="$master-reference"/>
310       </xsl:call-template>
311     </xsl:attribute>
312     <xsl:attribute name="force-page-count">
313       <xsl:call-template name="force.page.count">
314         <xsl:with-param name="master-reference" select="$master-reference"/>
315       </xsl:call-template>
316     </xsl:attribute>
317     <xsl:attribute name="hyphenation-character">
318       <xsl:call-template name="gentext">
319         <xsl:with-param name="key" select="'hyphenation-character'"/>
320       </xsl:call-template>
321     </xsl:attribute>
322     <xsl:attribute name="hyphenation-push-character-count">
323       <xsl:call-template name="gentext">
324         <xsl:with-param name="key" select="'hyphenation-push-character-count'"/>
325       </xsl:call-template>
326     </xsl:attribute>
327     <xsl:attribute name="hyphenation-remain-character-count">
328       <xsl:call-template name="gentext">
329         <xsl:with-param name="key" select="'hyphenation-remain-character-count'"/>
330       </xsl:call-template>
331     </xsl:attribute>
332
333     <xsl:apply-templates select="." mode="running.head.mode">
334       <xsl:with-param name="master-reference" select="$master-reference"/>
335     </xsl:apply-templates>
336
337     <xsl:apply-templates select="." mode="running.foot.mode">
338       <xsl:with-param name="master-reference" select="$master-reference"/>
339     </xsl:apply-templates>
340
341     <fo:flow flow-name="xsl-region-body">
342       <xsl:call-template name="set.flow.properties">
343         <xsl:with-param name="element" select="local-name(.)"/>
344         <xsl:with-param name="master-reference" select="$master-reference"/>
345       </xsl:call-template>
346
347       <fo:block id="{$id}"
348                 xsl:use-attribute-sets="component.titlepage.properties">
349         <xsl:call-template name="colophon.titlepage"/>
350       </fo:block>
351       <xsl:apply-templates/>
352     </fo:flow>
353   </fo:page-sequence>
354 </xsl:template>
355
356 <xsl:template match="colophon/title"></xsl:template>
357 <xsl:template match="colophon/subtitle"></xsl:template>
358 <xsl:template match="colophon/titleabbrev"></xsl:template>
359
360 <!-- ==================================================================== -->
361
362 <xsl:template match="preface">
363   <xsl:variable name="id">
364     <xsl:call-template name="object.id"/>
365   </xsl:variable>
366
367   <xsl:variable name="master-reference">
368     <xsl:call-template name="select.pagemaster"/>
369   </xsl:variable>
370
371   <fo:page-sequence hyphenate="{$hyphenate}"
372                     master-reference="{$master-reference}">
373     <xsl:attribute name="language">
374       <xsl:call-template name="l10n.language"/>
375     </xsl:attribute>
376     <xsl:attribute name="format">
377       <xsl:call-template name="page.number.format">
378         <xsl:with-param name="master-reference" select="$master-reference"/>
379       </xsl:call-template>
380     </xsl:attribute>
381
382     <xsl:attribute name="initial-page-number">
383       <xsl:call-template name="initial.page.number">
384         <xsl:with-param name="master-reference" select="$master-reference"/>
385       </xsl:call-template>
386     </xsl:attribute>
387
388     <xsl:attribute name="force-page-count">
389       <xsl:call-template name="force.page.count">
390         <xsl:with-param name="master-reference" select="$master-reference"/>
391       </xsl:call-template>
392     </xsl:attribute>
393
394     <xsl:attribute name="hyphenation-character">
395       <xsl:call-template name="gentext">
396         <xsl:with-param name="key" select="'hyphenation-character'"/>
397       </xsl:call-template>
398     </xsl:attribute>
399     <xsl:attribute name="hyphenation-push-character-count">
400       <xsl:call-template name="gentext">
401         <xsl:with-param name="key" select="'hyphenation-push-character-count'"/>
402       </xsl:call-template>
403     </xsl:attribute>
404     <xsl:attribute name="hyphenation-remain-character-count">
405       <xsl:call-template name="gentext">
406         <xsl:with-param name="key" select="'hyphenation-remain-character-count'"/>
407       </xsl:call-template>
408     </xsl:attribute>
409
410     <xsl:apply-templates select="." mode="running.head.mode">
411       <xsl:with-param name="master-reference" select="$master-reference"/>
412     </xsl:apply-templates>
413
414     <xsl:apply-templates select="." mode="running.foot.mode">
415       <xsl:with-param name="master-reference" select="$master-reference"/>
416     </xsl:apply-templates>
417
418     <fo:flow flow-name="xsl-region-body">
419       <xsl:call-template name="set.flow.properties">
420         <xsl:with-param name="element" select="local-name(.)"/>
421         <xsl:with-param name="master-reference" select="$master-reference"/>
422       </xsl:call-template>
423
424       <fo:block id="{$id}"
425                 xsl:use-attribute-sets="component.titlepage.properties">
426         <xsl:call-template name="preface.titlepage"/>
427       </fo:block>
428
429       <xsl:variable name="toc.params">
430         <xsl:call-template name="find.path.params">
431           <xsl:with-param name="table" 
432                           select="normalize-space($generate.toc)"/>
433         </xsl:call-template>
434       </xsl:variable>
435       <xsl:if test="contains($toc.params, 'toc')">
436         <xsl:call-template name="component.toc">
437           <xsl:with-param name="toc.title.p" 
438                           select="contains($toc.params, 'title')"/>
439         </xsl:call-template>
440         <xsl:call-template name="component.toc.separator"/>
441       </xsl:if>
442
443       <xsl:apply-templates/>
444     </fo:flow>
445   </fo:page-sequence>
446 </xsl:template>
447
448 <xsl:template match="preface/docinfo|prefaceinfo"></xsl:template>
449 <xsl:template match="preface/info"></xsl:template>
450 <xsl:template match="preface/title"></xsl:template>
451 <xsl:template match="preface/titleabbrev"></xsl:template>
452 <xsl:template match="preface/subtitle"></xsl:template>
453
454 <!-- ==================================================================== -->
455
456 <xsl:template match="chapter">
457   <xsl:variable name="id">
458     <xsl:call-template name="object.id"/>
459   </xsl:variable>
460
461   <xsl:variable name="master-reference">
462     <xsl:call-template name="select.pagemaster"/>
463   </xsl:variable>
464
465   <fo:page-sequence hyphenate="{$hyphenate}"
466                     master-reference="{$master-reference}">
467     <xsl:attribute name="language">
468       <xsl:call-template name="l10n.language"/>
469     </xsl:attribute>
470     <xsl:attribute name="format">
471       <xsl:call-template name="page.number.format">
472         <xsl:with-param name="master-reference" select="$master-reference"/>
473       </xsl:call-template>
474     </xsl:attribute>
475     <xsl:attribute name="initial-page-number">
476       <xsl:call-template name="initial.page.number">
477         <xsl:with-param name="master-reference" select="$master-reference"/>
478       </xsl:call-template>
479     </xsl:attribute>
480
481     <xsl:attribute name="force-page-count">
482       <xsl:call-template name="force.page.count">
483         <xsl:with-param name="master-reference" select="$master-reference"/>
484       </xsl:call-template>
485     </xsl:attribute>
486
487     <xsl:attribute name="hyphenation-character">
488       <xsl:call-template name="gentext">
489         <xsl:with-param name="key" select="'hyphenation-character'"/>
490       </xsl:call-template>
491     </xsl:attribute>
492     <xsl:attribute name="hyphenation-push-character-count">
493       <xsl:call-template name="gentext">
494         <xsl:with-param name="key" select="'hyphenation-push-character-count'"/>
495       </xsl:call-template>
496     </xsl:attribute>
497     <xsl:attribute name="hyphenation-remain-character-count">
498       <xsl:call-template name="gentext">
499         <xsl:with-param name="key" select="'hyphenation-remain-character-count'"/>
500       </xsl:call-template>
501     </xsl:attribute>
502
503     <xsl:apply-templates select="." mode="running.head.mode">
504       <xsl:with-param name="master-reference" select="$master-reference"/>
505     </xsl:apply-templates>
506
507     <xsl:apply-templates select="." mode="running.foot.mode">
508       <xsl:with-param name="master-reference" select="$master-reference"/>
509     </xsl:apply-templates>
510
511     <fo:flow flow-name="xsl-region-body">
512       <xsl:call-template name="set.flow.properties">
513         <xsl:with-param name="element" select="local-name(.)"/>
514         <xsl:with-param name="master-reference" select="$master-reference"/>
515       </xsl:call-template>
516
517       <fo:block id="{$id}"
518                 xsl:use-attribute-sets="component.titlepage.properties">
519         <xsl:call-template name="chapter.titlepage"/>
520       </fo:block>
521
522       <xsl:variable name="toc.params">
523         <xsl:call-template name="find.path.params">
524           <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
525         </xsl:call-template>
526       </xsl:variable>
527       <xsl:if test="contains($toc.params, 'toc')">
528         <xsl:call-template name="component.toc">
529           <xsl:with-param name="toc.title.p" 
530                           select="contains($toc.params, 'title')"/>
531         </xsl:call-template>
532         <xsl:call-template name="component.toc.separator"/>
533       </xsl:if>
534       <xsl:apply-templates/>
535     </fo:flow>
536   </fo:page-sequence>
537 </xsl:template>
538
539 <xsl:template match="chapter/docinfo|chapterinfo"></xsl:template>
540 <xsl:template match="chapter/info"></xsl:template>
541 <xsl:template match="chapter/title"></xsl:template>
542 <xsl:template match="chapter/titleabbrev"></xsl:template>
543 <xsl:template match="chapter/subtitle"></xsl:template>
544
545 <!-- ==================================================================== -->
546
547 <xsl:template match="appendix">
548   <xsl:variable name="id">
549     <xsl:call-template name="object.id"/>
550   </xsl:variable>
551
552   <xsl:variable name="master-reference">
553     <xsl:call-template name="select.pagemaster"/>
554   </xsl:variable>
555
556   <fo:page-sequence hyphenate="{$hyphenate}"
557                     master-reference="{$master-reference}">
558     <xsl:attribute name="language">
559       <xsl:call-template name="l10n.language"/>
560     </xsl:attribute>
561     <xsl:attribute name="format">
562       <xsl:call-template name="page.number.format">
563         <xsl:with-param name="master-reference" select="$master-reference"/>
564       </xsl:call-template>
565     </xsl:attribute>
566     <xsl:attribute name="initial-page-number">
567       <xsl:call-template name="initial.page.number">
568         <xsl:with-param name="master-reference" select="$master-reference"/>
569       </xsl:call-template>
570     </xsl:attribute>
571
572     <xsl:attribute name="force-page-count">
573       <xsl:call-template name="force.page.count">
574         <xsl:with-param name="master-reference" select="$master-reference"/>
575       </xsl:call-template>
576     </xsl:attribute>
577
578     <xsl:attribute name="hyphenation-character">
579       <xsl:call-template name="gentext">
580         <xsl:with-param name="key" select="'hyphenation-character'"/>
581       </xsl:call-template>
582     </xsl:attribute>
583     <xsl:attribute name="hyphenation-push-character-count">
584       <xsl:call-template name="gentext">
585         <xsl:with-param name="key" select="'hyphenation-push-character-count'"/>
586       </xsl:call-template>
587     </xsl:attribute>
588     <xsl:attribute name="hyphenation-remain-character-count">
589       <xsl:call-template name="gentext">
590         <xsl:with-param name="key" select="'hyphenation-remain-character-count'"/>
591       </xsl:call-template>
592     </xsl:attribute>
593
594     <xsl:apply-templates select="." mode="running.head.mode">
595       <xsl:with-param name="master-reference" select="$master-reference"/>
596     </xsl:apply-templates>
597
598     <xsl:apply-templates select="." mode="running.foot.mode">
599       <xsl:with-param name="master-reference" select="$master-reference"/>
600     </xsl:apply-templates>
601
602     <fo:flow flow-name="xsl-region-body">
603       <xsl:call-template name="set.flow.properties">
604         <xsl:with-param name="element" select="local-name(.)"/>
605         <xsl:with-param name="master-reference" select="$master-reference"/>
606       </xsl:call-template>
607
608       <fo:block id="{$id}"
609                 xsl:use-attribute-sets="component.titlepage.properties">
610         <xsl:call-template name="appendix.titlepage"/>
611       </fo:block>
612
613       <xsl:variable name="toc.params">
614         <xsl:call-template name="find.path.params">
615           <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
616         </xsl:call-template>
617       </xsl:variable>
618
619       <xsl:if test="contains($toc.params, 'toc')">
620         <xsl:call-template name="component.toc">
621           <xsl:with-param name="toc.title.p" 
622                           select="contains($toc.params, 'title')"/>
623         </xsl:call-template>
624         <xsl:call-template name="component.toc.separator"/>
625       </xsl:if>
626       <xsl:apply-templates/>
627     </fo:flow>
628   </fo:page-sequence>
629 </xsl:template>
630
631 <xsl:template match="appendix/docinfo|appendixinfo"></xsl:template>
632 <xsl:template match="appendix/info"></xsl:template>
633 <xsl:template match="appendix/title"></xsl:template>
634 <xsl:template match="appendix/titleabbrev"></xsl:template>
635 <xsl:template match="appendix/subtitle"></xsl:template>
636
637 <!-- ==================================================================== -->
638
639 <xsl:template match="article">
640   <xsl:variable name="id">
641     <xsl:call-template name="object.id"/>
642   </xsl:variable>
643
644   <xsl:variable name="master-reference">
645     <xsl:call-template name="select.pagemaster"/>
646   </xsl:variable>
647
648   <fo:page-sequence hyphenate="{$hyphenate}"
649                     master-reference="{$master-reference}">
650     <xsl:attribute name="language">
651       <xsl:call-template name="l10n.language"/>
652     </xsl:attribute>
653     <xsl:attribute name="format">
654       <xsl:call-template name="page.number.format">
655         <xsl:with-param name="master-reference" select="$master-reference"/>
656       </xsl:call-template>
657     </xsl:attribute>
658     <xsl:attribute name="initial-page-number">
659       <xsl:call-template name="initial.page.number">
660         <xsl:with-param name="master-reference" select="$master-reference"/>
661       </xsl:call-template>
662     </xsl:attribute>
663
664     <xsl:attribute name="force-page-count">
665       <xsl:call-template name="force.page.count">
666         <xsl:with-param name="master-reference" select="$master-reference"/>
667       </xsl:call-template>
668     </xsl:attribute>
669
670     <xsl:attribute name="hyphenation-character">
671       <xsl:call-template name="gentext">
672         <xsl:with-param name="key" select="'hyphenation-character'"/>
673       </xsl:call-template>
674     </xsl:attribute>
675     <xsl:attribute name="hyphenation-push-character-count">
676       <xsl:call-template name="gentext">
677         <xsl:with-param name="key" select="'hyphenation-push-character-count'"/>
678       </xsl:call-template>
679     </xsl:attribute>
680     <xsl:attribute name="hyphenation-remain-character-count">
681       <xsl:call-template name="gentext">
682         <xsl:with-param name="key" select="'hyphenation-remain-character-count'"/>
683       </xsl:call-template>
684     </xsl:attribute>
685
686     <xsl:apply-templates select="." mode="running.head.mode">
687       <xsl:with-param name="master-reference" select="$master-reference"/>
688     </xsl:apply-templates>
689
690     <xsl:apply-templates select="." mode="running.foot.mode">
691       <xsl:with-param name="master-reference" select="$master-reference"/>
692     </xsl:apply-templates>
693
694     <fo:flow flow-name="xsl-region-body">
695       <xsl:call-template name="set.flow.properties">
696         <xsl:with-param name="element" select="local-name(.)"/>
697         <xsl:with-param name="master-reference" select="$master-reference"/>
698       </xsl:call-template>
699
700       <fo:block id="{$id}"
701                 xsl:use-attribute-sets="component.titlepage.properties">
702         <xsl:call-template name="article.titlepage"/>
703       </fo:block>
704
705       <xsl:variable name="toc.params">
706         <xsl:call-template name="find.path.params">
707           <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
708         </xsl:call-template>
709       </xsl:variable>
710
711       <xsl:if test="contains($toc.params, 'toc')">
712         <xsl:call-template name="component.toc">
713           <xsl:with-param name="toc.title.p" 
714                           select="contains($toc.params, 'title')"/>
715         </xsl:call-template>
716         <xsl:call-template name="component.toc.separator"/>
717       </xsl:if>
718       <xsl:apply-templates/>
719     </fo:flow>
720   </fo:page-sequence>
721 </xsl:template>
722
723 <xsl:template match="article/artheader"></xsl:template>
724 <xsl:template match="article/articleinfo"></xsl:template>
725 <xsl:template match="article/info"></xsl:template>
726 <xsl:template match="article/title"></xsl:template>
727 <xsl:template match="article/subtitle"></xsl:template>
728 <xsl:template match="article/titleabbrev"></xsl:template>
729
730 <xsl:template match="article/appendix">
731   <xsl:variable name="id">
732     <xsl:call-template name="object.id"/>
733   </xsl:variable>
734
735   <xsl:variable name="title">
736     <xsl:apply-templates select="." mode="object.title.markup"/>
737   </xsl:variable>
738
739   <xsl:variable name="titleabbrev">
740     <xsl:apply-templates select="." mode="titleabbrev.markup"/>
741   </xsl:variable>
742
743   <fo:block id='{$id}'>
744     <xsl:if test="$axf.extensions != 0">
745       <xsl:attribute name="axf:outline-level">
746         <xsl:value-of select="count(ancestor::*)+2"/>
747       </xsl:attribute>
748       <xsl:attribute name="axf:outline-expand">false</xsl:attribute>
749       <xsl:attribute name="axf:outline-title">
750         <xsl:value-of select="normalize-space($titleabbrev)"/>
751       </xsl:attribute>
752     </xsl:if>
753
754     <xsl:if test="$passivetex.extensions != 0">
755       <fotex:bookmark xmlns:fotex="http://www.tug.org/fotex" 
756                       fotex-bookmark-level="{count(ancestor::*)+2}" 
757                       fotex-bookmark-label="{$id}">
758         <xsl:value-of select="$titleabbrev"/>
759       </fotex:bookmark>
760     </xsl:if>
761
762     <fo:block xsl:use-attribute-sets="article.appendix.title.properties">
763       <fo:marker marker-class-name="section.head.marker">
764         <xsl:choose>
765           <xsl:when test="$titleabbrev = ''">
766             <xsl:value-of select="$title"/>
767           </xsl:when>
768           <xsl:otherwise>
769             <xsl:value-of select="$titleabbrev"/>
770           </xsl:otherwise>
771         </xsl:choose>
772       </fo:marker>
773       <xsl:copy-of select="$title"/>
774     </fo:block>
775
776     <xsl:variable name="toc.params">
777         <xsl:call-template name="find.path.params">
778           <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
779         </xsl:call-template>
780       </xsl:variable>
781
782       <xsl:if test="contains($toc.params, 'toc')">
783         <xsl:call-template name="component.toc">
784           <xsl:with-param name="toc.title.p" 
785                           select="contains($toc.params, 'title')"/>
786         </xsl:call-template>
787         <xsl:call-template name="component.toc.separator"/>
788       </xsl:if>
789
790     <xsl:apply-templates/>
791   </fo:block>
792 </xsl:template>
793
794 <!-- ==================================================================== -->
795
796 <!-- Utility template to create a page sequence for an element -->
797 <xsl:template match="*" mode="page.sequence" name="page.sequence">
798   <xsl:param name="content">
799     <xsl:apply-templates/>
800   </xsl:param>
801   <xsl:param name="master-reference">
802     <xsl:call-template name="select.pagemaster"/>
803   </xsl:param>
804   <xsl:param name="element" select="local-name(.)"/>
805   <xsl:param name="gentext-key" select="local-name(.)"/>
806   <xsl:param name="language">
807     <xsl:call-template name="l10n.language"/>
808   </xsl:param>
809
810   <xsl:param name="format">
811     <xsl:call-template name="page.number.format">
812       <xsl:with-param name="master-reference" select="$master-reference"/>
813       <xsl:with-param name="element" select="$element"/>
814     </xsl:call-template>
815   </xsl:param>
816
817   <xsl:param name="initial-page-number">
818     <xsl:call-template name="initial.page.number">
819       <xsl:with-param name="master-reference" select="$master-reference"/>
820       <xsl:with-param name="element" select="$element"/>
821     </xsl:call-template>
822   </xsl:param>
823
824   <xsl:param name="force-page-count">
825     <xsl:call-template name="force.page.count">
826       <xsl:with-param name="master-reference" select="$master-reference"/>
827       <xsl:with-param name="element" select="$element"/>
828     </xsl:call-template>
829   </xsl:param>
830
831   <fo:page-sequence hyphenate="{$hyphenate}"
832                     master-reference="{$master-reference}">
833     <xsl:attribute name="language">
834       <xsl:value-of select="$language"/>
835     </xsl:attribute>
836     <xsl:attribute name="format">
837       <xsl:value-of select="$format"/>
838     </xsl:attribute>
839
840     <xsl:attribute name="initial-page-number">
841       <xsl:value-of select="$initial-page-number"/>
842     </xsl:attribute>
843
844     <xsl:attribute name="force-page-count">
845       <xsl:value-of select="$force-page-count"/>
846     </xsl:attribute>
847
848     <xsl:attribute name="hyphenation-character">
849       <xsl:call-template name="gentext">
850         <xsl:with-param name="key" select="'hyphenation-character'"/>
851       </xsl:call-template>
852     </xsl:attribute>
853     <xsl:attribute name="hyphenation-push-character-count">
854       <xsl:call-template name="gentext">
855         <xsl:with-param name="key" select="'hyphenation-push-character-count'"/>
856       </xsl:call-template>
857     </xsl:attribute>
858     <xsl:attribute name="hyphenation-remain-character-count">
859       <xsl:call-template name="gentext">
860         <xsl:with-param name="key" select="'hyphenation-remain-character-count'"/>
861       </xsl:call-template>
862     </xsl:attribute>
863
864     <xsl:apply-templates select="." mode="running.head.mode">
865       <xsl:with-param name="master-reference" select="$master-reference"/>
866       <xsl:with-param name="gentext-key" select="$gentext-key"/>
867     </xsl:apply-templates>
868
869     <xsl:apply-templates select="." mode="running.foot.mode">
870       <xsl:with-param name="master-reference" select="$master-reference"/>
871       <xsl:with-param name="gentext-key" select="$gentext-key"/>
872     </xsl:apply-templates>
873
874     <fo:flow flow-name="xsl-region-body">
875       <xsl:call-template name="set.flow.properties">
876         <xsl:with-param name="element" select="local-name(.)"/>
877         <xsl:with-param name="master-reference" select="$master-reference"/>
878       </xsl:call-template>
879
880       <xsl:copy-of select="$content"/>
881
882     </fo:flow>
883   </fo:page-sequence>
884 </xsl:template>
885
886 </xsl:stylesheet>
887