source: BOOK/stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/pagesetup.xsl@ 46d05a3

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since 46d05a3 was f8c4e94, checked in by Manuel Canales Esparcia <manuel@…>, 17 years ago

Added LFS XSL Stylesheets.

  • Property mode set to 100644
File size: 104.6 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$
8 ********************************************************************
9
10 This file is part of the DocBook XSL Stylesheet distribution.
11 See ../README or http://docbook.sf.net/ for copyright
12 copyright and other information.
13
14 ******************************************************************** -->
15
16<!-- ==================================================================== -->
17
18<xsl:param name="body.fontset">
19 <xsl:value-of select="$body.font.family"/>
20 <xsl:if test="$body.font.family != ''
21 and $symbol.font.family != ''">,</xsl:if>
22 <xsl:value-of select="$symbol.font.family"/>
23</xsl:param>
24
25<xsl:param name="title.fontset">
26 <xsl:value-of select="$title.font.family"/>
27 <xsl:if test="$title.font.family != ''
28 and $symbol.font.family != ''">,</xsl:if>
29 <xsl:value-of select="$symbol.font.family"/>
30</xsl:param>
31
32<!-- PassiveTeX can't handle the math expression for
33 title.margin.left being negative, so ignore it.
34 margin-left="{$page.margin.outer} - {$title.margin.left}"
35-->
36<xsl:param name="margin.left.outer">
37 <xsl:choose>
38 <xsl:when test="$passivetex.extensions != 0">
39 <xsl:value-of select="$page.margin.outer"/>
40 </xsl:when>
41 <xsl:otherwise>
42 <xsl:value-of select="$page.margin.outer"/>
43 <xsl:text> - </xsl:text>
44 <xsl:value-of select="$title.margin.left"/>
45 </xsl:otherwise>
46 </xsl:choose>
47</xsl:param>
48
49<xsl:param name="margin.left.inner">
50 <xsl:choose>
51 <xsl:when test="$passivetex.extensions != 0">
52 <xsl:value-of select="$page.margin.inner"/>
53 </xsl:when>
54 <xsl:otherwise>
55 <xsl:value-of select="$page.margin.inner"/>
56 <xsl:text> - </xsl:text>
57 <xsl:value-of select="$title.margin.left"/>
58 </xsl:otherwise>
59 </xsl:choose>
60</xsl:param>
61
62<xsl:template name="setup.pagemasters">
63 <fo:layout-master-set>
64 <!-- blank pages -->
65 <fo:simple-page-master master-name="blank"
66 page-width="{$page.width}"
67 page-height="{$page.height}"
68 margin-top="{$page.margin.top}"
69 margin-bottom="{$page.margin.bottom}"
70 margin-left="{$margin.left.outer}"
71 margin-right="{$page.margin.inner}">
72 <xsl:if test="$axf.extensions != 0">
73 <xsl:call-template name="axf-page-master-properties">
74 <xsl:with-param name="page.master">blank</xsl:with-param>
75 </xsl:call-template>
76 </xsl:if>
77 <fo:region-body display-align="center"
78 margin-bottom="{$body.margin.bottom}"
79 margin-top="{$body.margin.top}">
80 <xsl:if test="$fop.extensions = 0 and $fop1.extensions = 0">
81 <xsl:attribute name="region-name">blank-body</xsl:attribute>
82 </xsl:if>
83 </fo:region-body>
84 <fo:region-before region-name="xsl-region-before-blank"
85 extent="{$region.before.extent}"
86 display-align="before"/>
87 <fo:region-after region-name="xsl-region-after-blank"
88 extent="{$region.after.extent}"
89 display-align="after"/>
90 </fo:simple-page-master>
91
92 <!-- title pages -->
93 <fo:simple-page-master master-name="titlepage-first"
94 page-width="{$page.width}"
95 page-height="{$page.height}"
96 margin-top="{$page.margin.top}"
97 margin-bottom="{$page.margin.bottom}"
98 margin-left="{$margin.left.inner}"
99 margin-right="{$page.margin.outer}">
100 <xsl:if test="$axf.extensions != 0">
101 <xsl:call-template name="axf-page-master-properties">
102 <xsl:with-param name="page.master">titlepage-first</xsl:with-param>
103 </xsl:call-template>
104 </xsl:if>
105 <fo:region-body margin-bottom="{$body.margin.bottom}"
106 margin-top="{$body.margin.top}"
107 column-gap="{$column.gap.titlepage}"
108 column-count="{$column.count.titlepage}">
109 </fo:region-body>
110 <fo:region-before region-name="xsl-region-before-first"
111 extent="{$region.before.extent}"
112 display-align="before"/>
113 <fo:region-after region-name="xsl-region-after-first"
114 extent="{$region.after.extent}"
115 display-align="after"/>
116 </fo:simple-page-master>
117
118 <fo:simple-page-master master-name="titlepage-odd"
119 page-width="{$page.width}"
120 page-height="{$page.height}"
121 margin-top="{$page.margin.top}"
122 margin-bottom="{$page.margin.bottom}"
123 margin-left="{$margin.left.inner}"
124 margin-right="{$page.margin.outer}">
125 <xsl:if test="$axf.extensions != 0">
126 <xsl:call-template name="axf-page-master-properties">
127 <xsl:with-param name="page.master">titlepage-odd</xsl:with-param>
128 </xsl:call-template>
129 </xsl:if>
130 <fo:region-body margin-bottom="{$body.margin.bottom}"
131 margin-top="{$body.margin.top}"
132 column-gap="{$column.gap.titlepage}"
133 column-count="{$column.count.titlepage}">
134 </fo:region-body>
135 <fo:region-before region-name="xsl-region-before-odd"
136 extent="{$region.before.extent}"
137 display-align="before"/>
138 <fo:region-after region-name="xsl-region-after-odd"
139 extent="{$region.after.extent}"
140 display-align="after"/>
141 </fo:simple-page-master>
142
143 <fo:simple-page-master master-name="titlepage-even"
144 page-width="{$page.width}"
145 page-height="{$page.height}"
146 margin-top="{$page.margin.top}"
147 margin-bottom="{$page.margin.bottom}"
148 margin-left="{$margin.left.outer}"
149 margin-right="{$page.margin.inner}">
150 <xsl:if test="$axf.extensions != 0">
151 <xsl:call-template name="axf-page-master-properties">
152 <xsl:with-param name="page.master">titlepage-even</xsl:with-param>
153 </xsl:call-template>
154 </xsl:if>
155 <fo:region-body margin-bottom="{$body.margin.bottom}"
156 margin-top="{$body.margin.top}"
157 column-gap="{$column.gap.titlepage}"
158 column-count="{$column.count.titlepage}">
159 </fo:region-body>
160 <fo:region-before region-name="xsl-region-before-even"
161 extent="{$region.before.extent}"
162 display-align="before"/>
163 <fo:region-after region-name="xsl-region-after-even"
164 extent="{$region.after.extent}"
165 display-align="after"/>
166 </fo:simple-page-master>
167
168 <!-- list-of-title pages -->
169 <fo:simple-page-master master-name="lot-first"
170 page-width="{$page.width}"
171 page-height="{$page.height}"
172 margin-top="{$page.margin.top}"
173 margin-bottom="{$page.margin.bottom}"
174 margin-left="{$margin.left.inner}"
175 margin-right="{$page.margin.outer}">
176 <xsl:if test="$axf.extensions != 0">
177 <xsl:call-template name="axf-page-master-properties">
178 <xsl:with-param name="page.master">lot-first</xsl:with-param>
179 </xsl:call-template>
180 </xsl:if>
181 <fo:region-body margin-bottom="{$body.margin.bottom}"
182 margin-top="{$body.margin.top}"
183 column-gap="{$column.gap.lot}"
184 column-count="{$column.count.lot}">
185 </fo:region-body>
186 <fo:region-before region-name="xsl-region-before-first"
187 extent="{$region.before.extent}"
188 display-align="before"/>
189 <fo:region-after region-name="xsl-region-after-first"
190 extent="{$region.after.extent}"
191 display-align="after"/>
192 </fo:simple-page-master>
193
194 <fo:simple-page-master master-name="lot-odd"
195 page-width="{$page.width}"
196 page-height="{$page.height}"
197 margin-top="{$page.margin.top}"
198 margin-bottom="{$page.margin.bottom}"
199 margin-left="{$margin.left.inner}"
200 margin-right="{$page.margin.outer}">
201 <xsl:if test="$axf.extensions != 0">
202 <xsl:call-template name="axf-page-master-properties">
203 <xsl:with-param name="page.master">lot-odd</xsl:with-param>
204 </xsl:call-template>
205 </xsl:if>
206 <fo:region-body margin-bottom="{$body.margin.bottom}"
207 margin-top="{$body.margin.top}"
208 column-gap="{$column.gap.lot}"
209 column-count="{$column.count.lot}">
210 </fo:region-body>
211 <fo:region-before region-name="xsl-region-before-odd"
212 extent="{$region.before.extent}"
213 display-align="before"/>
214 <fo:region-after region-name="xsl-region-after-odd"
215 extent="{$region.after.extent}"
216 display-align="after"/>
217 </fo:simple-page-master>
218
219 <fo:simple-page-master master-name="lot-even"
220 page-width="{$page.width}"
221 page-height="{$page.height}"
222 margin-top="{$page.margin.top}"
223 margin-bottom="{$page.margin.bottom}"
224 margin-left="{$margin.left.outer}"
225 margin-right="{$page.margin.inner}">
226 <xsl:if test="$axf.extensions != 0">
227 <xsl:call-template name="axf-page-master-properties">
228 <xsl:with-param name="page.master">lot-even</xsl:with-param>
229 </xsl:call-template>
230 </xsl:if>
231 <fo:region-body margin-bottom="{$body.margin.bottom}"
232 margin-top="{$body.margin.top}"
233 column-gap="{$column.gap.lot}"
234 column-count="{$column.count.lot}">
235 </fo:region-body>
236 <fo:region-before region-name="xsl-region-before-even"
237 extent="{$region.before.extent}"
238 display-align="before"/>
239 <fo:region-after region-name="xsl-region-after-even"
240 extent="{$region.after.extent}"
241 display-align="after"/>
242 </fo:simple-page-master>
243
244 <!-- frontmatter pages -->
245 <fo:simple-page-master master-name="front-first"
246 page-width="{$page.width}"
247 page-height="{$page.height}"
248 margin-top="{$page.margin.top}"
249 margin-bottom="{$page.margin.bottom}"
250 margin-left="{$margin.left.inner}"
251 margin-right="{$page.margin.outer}">
252 <xsl:if test="$axf.extensions != 0">
253 <xsl:call-template name="axf-page-master-properties">
254 <xsl:with-param name="page.master">front-first</xsl:with-param>
255 </xsl:call-template>
256 </xsl:if>
257 <fo:region-body margin-bottom="{$body.margin.bottom}"
258 margin-top="{$body.margin.top}"
259 column-gap="{$column.gap.front}"
260 column-count="{$column.count.front}">
261 </fo:region-body>
262 <fo:region-before region-name="xsl-region-before-first"
263 extent="{$region.before.extent}"
264 display-align="before"/>
265 <fo:region-after region-name="xsl-region-after-first"
266 extent="{$region.after.extent}"
267 display-align="after"/>
268 </fo:simple-page-master>
269
270 <fo:simple-page-master master-name="front-odd"
271 page-width="{$page.width}"
272 page-height="{$page.height}"
273 margin-top="{$page.margin.top}"
274 margin-bottom="{$page.margin.bottom}"
275 margin-left="{$margin.left.inner}"
276 margin-right="{$page.margin.outer}">
277 <xsl:if test="$axf.extensions != 0">
278 <xsl:call-template name="axf-page-master-properties">
279 <xsl:with-param name="page.master">front-odd</xsl:with-param>
280 </xsl:call-template>
281 </xsl:if>
282 <fo:region-body margin-bottom="{$body.margin.bottom}"
283 margin-top="{$body.margin.top}"
284 column-gap="{$column.gap.front}"
285 column-count="{$column.count.front}">
286 </fo:region-body>
287 <fo:region-before region-name="xsl-region-before-odd"
288 extent="{$region.before.extent}"
289 display-align="before"/>
290 <fo:region-after region-name="xsl-region-after-odd"
291 extent="{$region.after.extent}"
292 display-align="after"/>
293 </fo:simple-page-master>
294
295 <fo:simple-page-master master-name="front-even"
296 page-width="{$page.width}"
297 page-height="{$page.height}"
298 margin-top="{$page.margin.top}"
299 margin-bottom="{$page.margin.bottom}"
300 margin-left="{$margin.left.outer}"
301 margin-right="{$page.margin.inner}">
302 <xsl:if test="$axf.extensions != 0">
303 <xsl:call-template name="axf-page-master-properties">
304 <xsl:with-param name="page.master">front-even</xsl:with-param>
305 </xsl:call-template>
306 </xsl:if>
307 <fo:region-body margin-bottom="{$body.margin.bottom}"
308 margin-top="{$body.margin.top}"
309 column-gap="{$column.gap.front}"
310 column-count="{$column.count.front}">
311 </fo:region-body>
312 <fo:region-before region-name="xsl-region-before-even"
313 extent="{$region.before.extent}"
314 display-align="before"/>
315 <fo:region-after region-name="xsl-region-after-even"
316 extent="{$region.after.extent}"
317 display-align="after"/>
318 </fo:simple-page-master>
319
320 <!-- body pages -->
321 <fo:simple-page-master master-name="body-first"
322 page-width="{$page.width}"
323 page-height="{$page.height}"
324 margin-top="{$page.margin.top}"
325 margin-bottom="{$page.margin.bottom}"
326 margin-left="{$margin.left.inner}"
327 margin-right="{$page.margin.outer}">
328 <xsl:if test="$axf.extensions != 0">
329 <xsl:call-template name="axf-page-master-properties">
330 <xsl:with-param name="page.master">body-first</xsl:with-param>
331 </xsl:call-template>
332 </xsl:if>
333 <fo:region-body margin-bottom="{$body.margin.bottom}"
334 margin-top="{$body.margin.top}"
335 column-gap="{$column.gap.body}"
336 column-count="{$column.count.body}">
337 </fo:region-body>
338 <fo:region-before region-name="xsl-region-before-first"
339 extent="{$region.before.extent}"
340 display-align="before"/>
341 <fo:region-after region-name="xsl-region-after-first"
342 extent="{$region.after.extent}"
343 display-align="after"/>
344 </fo:simple-page-master>
345
346 <fo:simple-page-master master-name="body-odd"
347 page-width="{$page.width}"
348 page-height="{$page.height}"
349 margin-top="{$page.margin.top}"
350 margin-bottom="{$page.margin.bottom}"
351 margin-left="{$margin.left.inner}"
352 margin-right="{$page.margin.outer}">
353 <xsl:if test="$axf.extensions != 0">
354 <xsl:call-template name="axf-page-master-properties">
355 <xsl:with-param name="page.master">body-odd</xsl:with-param>
356 </xsl:call-template>
357 </xsl:if>
358 <fo:region-body margin-bottom="{$body.margin.bottom}"
359 margin-top="{$body.margin.top}"
360 column-gap="{$column.gap.body}"
361 column-count="{$column.count.body}">
362 </fo:region-body>
363 <fo:region-before region-name="xsl-region-before-odd"
364 extent="{$region.before.extent}"
365 display-align="before"/>
366 <fo:region-after region-name="xsl-region-after-odd"
367 extent="{$region.after.extent}"
368 display-align="after"/>
369 </fo:simple-page-master>
370
371 <fo:simple-page-master master-name="body-even"
372 page-width="{$page.width}"
373 page-height="{$page.height}"
374 margin-top="{$page.margin.top}"
375 margin-bottom="{$page.margin.bottom}"
376 margin-left="{$margin.left.outer}"
377 margin-right="{$page.margin.inner}">
378 <xsl:if test="$axf.extensions != 0">
379 <xsl:call-template name="axf-page-master-properties">
380 <xsl:with-param name="page.master">body-even</xsl:with-param>
381 </xsl:call-template>
382 </xsl:if>
383 <fo:region-body margin-bottom="{$body.margin.bottom}"
384 margin-top="{$body.margin.top}"
385 column-gap="{$column.gap.body}"
386 column-count="{$column.count.body}">
387 </fo:region-body>
388 <fo:region-before region-name="xsl-region-before-even"
389 extent="{$region.before.extent}"
390 display-align="before"/>
391 <fo:region-after region-name="xsl-region-after-even"
392 extent="{$region.after.extent}"
393 display-align="after"/>
394 </fo:simple-page-master>
395
396 <!-- backmatter pages -->
397 <fo:simple-page-master master-name="back-first"
398 page-width="{$page.width}"
399 page-height="{$page.height}"
400 margin-top="{$page.margin.top}"
401 margin-bottom="{$page.margin.bottom}"
402 margin-left="{$margin.left.inner}"
403 margin-right="{$page.margin.outer}">
404 <xsl:if test="$axf.extensions != 0">
405 <xsl:call-template name="axf-page-master-properties">
406 <xsl:with-param name="page.master">back-first</xsl:with-param>
407 </xsl:call-template>
408 </xsl:if>
409 <fo:region-body margin-bottom="{$body.margin.bottom}"
410 margin-top="{$body.margin.top}"
411 column-gap="{$column.gap.back}"
412 column-count="{$column.count.back}">
413 </fo:region-body>
414 <fo:region-before region-name="xsl-region-before-first"
415 extent="{$region.before.extent}"
416 display-align="before"/>
417 <fo:region-after region-name="xsl-region-after-first"
418 extent="{$region.after.extent}"
419 display-align="after"/>
420 </fo:simple-page-master>
421
422 <fo:simple-page-master master-name="back-odd"
423 page-width="{$page.width}"
424 page-height="{$page.height}"
425 margin-top="{$page.margin.top}"
426 margin-bottom="{$page.margin.bottom}"
427 margin-left="{$margin.left.inner}"
428 margin-right="{$page.margin.outer}">
429 <xsl:if test="$axf.extensions != 0">
430 <xsl:call-template name="axf-page-master-properties">
431 <xsl:with-param name="page.master">back-odd</xsl:with-param>
432 </xsl:call-template>
433 </xsl:if>
434 <fo:region-body margin-bottom="{$body.margin.bottom}"
435 margin-top="{$body.margin.top}"
436 column-gap="{$column.gap.back}"
437 column-count="{$column.count.back}">
438 </fo:region-body>
439 <fo:region-before region-name="xsl-region-before-odd"
440 extent="{$region.before.extent}"
441 display-align="before"/>
442 <fo:region-after region-name="xsl-region-after-odd"
443 extent="{$region.after.extent}"
444 display-align="after"/>
445 </fo:simple-page-master>
446
447 <fo:simple-page-master master-name="back-even"
448 page-width="{$page.width}"
449 page-height="{$page.height}"
450 margin-top="{$page.margin.top}"
451 margin-bottom="{$page.margin.bottom}"
452 margin-left="{$margin.left.outer}"
453 margin-right="{$page.margin.inner}">
454 <xsl:if test="$axf.extensions != 0">
455 <xsl:call-template name="axf-page-master-properties">
456 <xsl:with-param name="page.master">back-even</xsl:with-param>
457 </xsl:call-template>
458 </xsl:if>
459 <fo:region-body margin-bottom="{$body.margin.bottom}"
460 margin-top="{$body.margin.top}"
461 column-gap="{$column.gap.back}"
462 column-count="{$column.count.back}">
463 </fo:region-body>
464 <fo:region-before region-name="xsl-region-before-even"
465 extent="{$region.before.extent}"
466 display-align="before"/>
467 <fo:region-after region-name="xsl-region-after-even"
468 extent="{$region.after.extent}"
469 display-align="after"/>
470 </fo:simple-page-master>
471
472 <!-- index pages -->
473 <fo:simple-page-master master-name="index-first"
474 page-width="{$page.width}"
475 page-height="{$page.height}"
476 margin-top="{$page.margin.top}"
477 margin-bottom="{$page.margin.bottom}"
478 margin-left="{$page.margin.inner}"
479 margin-right="{$page.margin.outer}">
480 <xsl:if test="$axf.extensions != 0">
481 <xsl:call-template name="axf-page-master-properties">
482 <xsl:with-param name="page.master">index-first</xsl:with-param>
483 </xsl:call-template>
484 </xsl:if>
485 <fo:region-body margin-bottom="{$body.margin.bottom}"
486 margin-top="{$body.margin.top}"
487 column-gap="{$column.gap.index}"
488 column-count="{$column.count.index}">
489 </fo:region-body>
490 <fo:region-before region-name="xsl-region-before-first"
491 extent="{$region.before.extent}"
492 display-align="before"/>
493 <fo:region-after region-name="xsl-region-after-first"
494 extent="{$region.after.extent}"
495 display-align="after"/>
496 </fo:simple-page-master>
497
498 <fo:simple-page-master master-name="index-odd"
499 page-width="{$page.width}"
500 page-height="{$page.height}"
501 margin-top="{$page.margin.top}"
502 margin-bottom="{$page.margin.bottom}"
503 margin-left="{$page.margin.inner}"
504 margin-right="{$page.margin.outer}">
505 <xsl:if test="$axf.extensions != 0">
506 <xsl:call-template name="axf-page-master-properties">
507 <xsl:with-param name="page.master">index-odd</xsl:with-param>
508 </xsl:call-template>
509 </xsl:if>
510 <fo:region-body margin-bottom="{$body.margin.bottom}"
511 margin-top="{$body.margin.top}"
512 column-gap="{$column.gap.index}"
513 column-count="{$column.count.index}">
514 </fo:region-body>
515 <fo:region-before region-name="xsl-region-before-odd"
516 extent="{$region.before.extent}"
517 display-align="before"/>
518 <fo:region-after region-name="xsl-region-after-odd"
519 extent="{$region.after.extent}"
520 display-align="after"/>
521 </fo:simple-page-master>
522
523 <fo:simple-page-master master-name="index-even"
524 page-width="{$page.width}"
525 page-height="{$page.height}"
526 margin-top="{$page.margin.top}"
527 margin-bottom="{$page.margin.bottom}"
528 margin-left="{$page.margin.outer}"
529 margin-right="{$page.margin.inner}">
530 <xsl:if test="$axf.extensions != 0">
531 <xsl:call-template name="axf-page-master-properties">
532 <xsl:with-param name="page.master">index-even</xsl:with-param>
533 </xsl:call-template>
534 </xsl:if>
535 <fo:region-body margin-bottom="{$body.margin.bottom}"
536 margin-top="{$body.margin.top}"
537 column-gap="{$column.gap.index}"
538 column-count="{$column.count.index}">
539 </fo:region-body>
540 <fo:region-before region-name="xsl-region-before-even"
541 extent="{$region.before.extent}"
542 display-align="before"/>
543 <fo:region-after region-name="xsl-region-after-even"
544 extent="{$region.after.extent}"
545 display-align="after"/>
546 </fo:simple-page-master>
547
548 <xsl:if test="$draft.mode != 'no'">
549 <!-- draft blank pages -->
550 <fo:simple-page-master master-name="blank-draft"
551 page-width="{$page.width}"
552 page-height="{$page.height}"
553 margin-top="{$page.margin.top}"
554 margin-bottom="{$page.margin.bottom}"
555 margin-left="{$margin.left.outer}"
556 margin-right="{$page.margin.inner}">
557 <xsl:if test="$axf.extensions != 0">
558 <xsl:call-template name="axf-page-master-properties">
559 <xsl:with-param name="page.master">blank-draft</xsl:with-param>
560 </xsl:call-template>
561 </xsl:if>
562 <fo:region-body margin-bottom="{$body.margin.bottom}"
563 margin-top="{$body.margin.top}">
564 <xsl:if test="$draft.watermark.image != ''">
565 <xsl:attribute name="background-image">
566 <xsl:call-template name="fo-external-image">
567 <xsl:with-param name="filename" select="$draft.watermark.image"/>
568 </xsl:call-template>
569 </xsl:attribute>
570 <xsl:attribute name="background-attachment">fixed</xsl:attribute>
571 <xsl:attribute name="background-repeat">no-repeat</xsl:attribute>
572 <xsl:attribute name="background-position-horizontal">center</xsl:attribute>
573 <xsl:attribute name="background-position-vertical">center</xsl:attribute>
574 </xsl:if>
575 </fo:region-body>
576 <fo:region-before region-name="xsl-region-before-blank"
577 extent="{$region.before.extent}"
578 display-align="before"/>
579 <fo:region-after region-name="xsl-region-after-blank"
580 extent="{$region.after.extent}"
581 display-align="after"/>
582 </fo:simple-page-master>
583
584 <!-- draft title pages -->
585 <fo:simple-page-master master-name="titlepage-first-draft"
586 page-width="{$page.width}"
587 page-height="{$page.height}"
588 margin-top="{$page.margin.top}"
589 margin-bottom="{$page.margin.bottom}"
590 margin-left="{$margin.left.inner}"
591 margin-right="{$page.margin.outer}">
592 <xsl:if test="$axf.extensions != 0">
593 <xsl:call-template name="axf-page-master-properties">
594 <xsl:with-param name="page.master">titlepage-first-draft</xsl:with-param>
595 </xsl:call-template>
596 </xsl:if>
597 <fo:region-body margin-bottom="{$body.margin.bottom}"
598 margin-top="{$body.margin.top}"
599 column-gap="{$column.gap.titlepage}"
600 column-count="{$column.count.titlepage}">
601 <xsl:if test="$draft.watermark.image != ''">
602 <xsl:attribute name="background-image">
603 <xsl:call-template name="fo-external-image">
604 <xsl:with-param name="filename" select="$draft.watermark.image"/>
605 </xsl:call-template>
606 </xsl:attribute>
607 <xsl:attribute name="background-attachment">fixed</xsl:attribute>
608 <xsl:attribute name="background-repeat">no-repeat</xsl:attribute>
609 <xsl:attribute name="background-position-horizontal">center</xsl:attribute>
610 <xsl:attribute name="background-position-vertical">center</xsl:attribute>
611 </xsl:if>
612 </fo:region-body>
613 <fo:region-before region-name="xsl-region-before-first"
614 extent="{$region.before.extent}"
615 display-align="before"/>
616 <fo:region-after region-name="xsl-region-after-first"
617 extent="{$region.after.extent}"
618 display-align="after"/>
619 </fo:simple-page-master>
620
621 <fo:simple-page-master master-name="titlepage-odd-draft"
622 page-width="{$page.width}"
623 page-height="{$page.height}"
624 margin-top="{$page.margin.top}"
625 margin-bottom="{$page.margin.bottom}"
626 margin-left="{$margin.left.inner}"
627 margin-right="{$page.margin.outer}">
628 <xsl:if test="$axf.extensions != 0">
629 <xsl:call-template name="axf-page-master-properties">
630 <xsl:with-param name="page.master">titlepage-odd-draft</xsl:with-param>
631 </xsl:call-template>
632 </xsl:if>
633 <fo:region-body margin-bottom="{$body.margin.bottom}"
634 margin-top="{$body.margin.top}"
635 column-gap="{$column.gap.titlepage}"
636 column-count="{$column.count.titlepage}">
637 <xsl:if test="$draft.watermark.image != ''">
638 <xsl:attribute name="background-image">
639 <xsl:call-template name="fo-external-image">
640 <xsl:with-param name="filename" select="$draft.watermark.image"/>
641 </xsl:call-template>
642 </xsl:attribute>
643 <xsl:attribute name="background-attachment">fixed</xsl:attribute>
644 <xsl:attribute name="background-repeat">no-repeat</xsl:attribute>
645 <xsl:attribute name="background-position-horizontal">center</xsl:attribute>
646 <xsl:attribute name="background-position-vertical">center</xsl:attribute>
647 </xsl:if>
648 </fo:region-body>
649 <fo:region-before region-name="xsl-region-before-odd"
650 extent="{$region.before.extent}"
651 display-align="before"/>
652 <fo:region-after region-name="xsl-region-after-odd"
653 extent="{$region.after.extent}"
654 display-align="after"/>
655 </fo:simple-page-master>
656
657 <fo:simple-page-master master-name="titlepage-even-draft"
658 page-width="{$page.width}"
659 page-height="{$page.height}"
660 margin-top="{$page.margin.top}"
661 margin-bottom="{$page.margin.bottom}"
662 margin-left="{$margin.left.outer}"
663 margin-right="{$page.margin.inner}">
664 <xsl:if test="$axf.extensions != 0">
665 <xsl:call-template name="axf-page-master-properties">
666 <xsl:with-param name="page.master">titlepage-even-draft</xsl:with-param>
667 </xsl:call-template>
668 </xsl:if>
669 <fo:region-body margin-bottom="{$body.margin.bottom}"
670 margin-top="{$body.margin.top}"
671 column-gap="{$column.gap.titlepage}"
672 column-count="{$column.count.titlepage}">
673 <xsl:if test="$draft.watermark.image != ''">
674 <xsl:attribute name="background-image">
675 <xsl:call-template name="fo-external-image">
676 <xsl:with-param name="filename" select="$draft.watermark.image"/>
677 </xsl:call-template>
678 </xsl:attribute>
679 <xsl:attribute name="background-attachment">fixed</xsl:attribute>
680 <xsl:attribute name="background-repeat">no-repeat</xsl:attribute>
681 <xsl:attribute name="background-position-horizontal">center</xsl:attribute>
682 <xsl:attribute name="background-position-vertical">center</xsl:attribute>
683 </xsl:if>
684 </fo:region-body>
685 <fo:region-before region-name="xsl-region-before-even"
686 extent="{$region.before.extent}"
687 display-align="before"/>
688 <fo:region-after region-name="xsl-region-after-even"
689 extent="{$region.after.extent}"
690 display-align="after"/>
691 </fo:simple-page-master>
692
693 <!-- draft list-of-title pages -->
694 <fo:simple-page-master master-name="lot-first-draft"
695 page-width="{$page.width}"
696 page-height="{$page.height}"
697 margin-top="{$page.margin.top}"
698 margin-bottom="{$page.margin.bottom}"
699 margin-left="{$margin.left.inner}"
700 margin-right="{$page.margin.outer}">
701 <xsl:if test="$axf.extensions != 0">
702 <xsl:call-template name="axf-page-master-properties">
703 <xsl:with-param name="page.master">lot-first-draft</xsl:with-param>
704 </xsl:call-template>
705 </xsl:if>
706 <fo:region-body margin-bottom="{$body.margin.bottom}"
707 margin-top="{$body.margin.top}"
708 column-gap="{$column.gap.lot}"
709 column-count="{$column.count.lot}">
710 <xsl:if test="$draft.watermark.image != ''">
711 <xsl:attribute name="background-image">
712 <xsl:call-template name="fo-external-image">
713 <xsl:with-param name="filename" select="$draft.watermark.image"/>
714 </xsl:call-template>
715 </xsl:attribute>
716 <xsl:attribute name="background-attachment">fixed</xsl:attribute>
717 <xsl:attribute name="background-repeat">no-repeat</xsl:attribute>
718 <xsl:attribute name="background-position-horizontal">center</xsl:attribute>
719 <xsl:attribute name="background-position-vertical">center</xsl:attribute>
720 </xsl:if>
721 </fo:region-body>
722 <fo:region-before region-name="xsl-region-before-first"
723 extent="{$region.before.extent}"
724 display-align="before"/>
725 <fo:region-after region-name="xsl-region-after-first"
726 extent="{$region.after.extent}"
727 display-align="after"/>
728 </fo:simple-page-master>
729
730 <fo:simple-page-master master-name="lot-odd-draft"
731 page-width="{$page.width}"
732 page-height="{$page.height}"
733 margin-top="{$page.margin.top}"
734 margin-bottom="{$page.margin.bottom}"
735 margin-left="{$margin.left.inner}"
736 margin-right="{$page.margin.outer}">
737 <xsl:if test="$axf.extensions != 0">
738 <xsl:call-template name="axf-page-master-properties">
739 <xsl:with-param name="page.master">lot-odd-draft</xsl:with-param>
740 </xsl:call-template>
741 </xsl:if>
742 <fo:region-body margin-bottom="{$body.margin.bottom}"
743 margin-top="{$body.margin.top}"
744 column-gap="{$column.gap.lot}"
745 column-count="{$column.count.lot}">
746 <xsl:if test="$draft.watermark.image != ''">
747 <xsl:attribute name="background-image">
748 <xsl:call-template name="fo-external-image">
749 <xsl:with-param name="filename" select="$draft.watermark.image"/>
750 </xsl:call-template>
751 </xsl:attribute>
752 <xsl:attribute name="background-attachment">fixed</xsl:attribute>
753 <xsl:attribute name="background-repeat">no-repeat</xsl:attribute>
754 <xsl:attribute name="background-position-horizontal">center</xsl:attribute>
755 <xsl:attribute name="background-position-vertical">center</xsl:attribute>
756 </xsl:if>
757 </fo:region-body>
758 <fo:region-before region-name="xsl-region-before-odd"
759 extent="{$region.before.extent}"
760 display-align="before"/>
761 <fo:region-after region-name="xsl-region-after-odd"
762 extent="{$region.after.extent}"
763 display-align="after"/>
764 </fo:simple-page-master>
765
766 <fo:simple-page-master master-name="lot-even-draft"
767 page-width="{$page.width}"
768 page-height="{$page.height}"
769 margin-top="{$page.margin.top}"
770 margin-bottom="{$page.margin.bottom}"
771 margin-left="{$margin.left.outer}"
772 margin-right="{$page.margin.inner}">
773 <xsl:if test="$axf.extensions != 0">
774 <xsl:call-template name="axf-page-master-properties">
775 <xsl:with-param name="page.master">lot-even-draft</xsl:with-param>
776 </xsl:call-template>
777 </xsl:if>
778 <fo:region-body margin-bottom="{$body.margin.bottom}"
779 margin-top="{$body.margin.top}"
780 column-gap="{$column.gap.lot}"
781 column-count="{$column.count.lot}">
782 <xsl:if test="$draft.watermark.image != ''">
783 <xsl:attribute name="background-image">
784 <xsl:call-template name="fo-external-image">
785 <xsl:with-param name="filename" select="$draft.watermark.image"/>
786 </xsl:call-template>
787 </xsl:attribute>
788 <xsl:attribute name="background-attachment">fixed</xsl:attribute>
789 <xsl:attribute name="background-repeat">no-repeat</xsl:attribute>
790 <xsl:attribute name="background-position-horizontal">center</xsl:attribute>
791 <xsl:attribute name="background-position-vertical">center</xsl:attribute>
792 </xsl:if>
793 </fo:region-body>
794 <fo:region-before region-name="xsl-region-before-even"
795 extent="{$region.before.extent}"
796 display-align="before"/>
797 <fo:region-after region-name="xsl-region-after-even"
798 extent="{$region.after.extent}"
799 display-align="after"/>
800 </fo:simple-page-master>
801
802 <!-- draft frontmatter pages -->
803 <fo:simple-page-master master-name="front-first-draft"
804 page-width="{$page.width}"
805 page-height="{$page.height}"
806 margin-top="{$page.margin.top}"
807 margin-bottom="{$page.margin.bottom}"
808 margin-left="{$margin.left.inner}"
809 margin-right="{$page.margin.outer}">
810 <xsl:if test="$axf.extensions != 0">
811 <xsl:call-template name="axf-page-master-properties">
812 <xsl:with-param name="page.master">front-first-draft</xsl:with-param>
813 </xsl:call-template>
814 </xsl:if>
815 <fo:region-body margin-bottom="{$body.margin.bottom}"
816 margin-top="{$body.margin.top}"
817 column-gap="{$column.gap.front}"
818 column-count="{$column.count.front}">
819 <xsl:if test="$draft.watermark.image != ''">
820 <xsl:attribute name="background-image">
821 <xsl:call-template name="fo-external-image">
822 <xsl:with-param name="filename" select="$draft.watermark.image"/>
823 </xsl:call-template>
824 </xsl:attribute>
825 <xsl:attribute name="background-attachment">fixed</xsl:attribute>
826 <xsl:attribute name="background-repeat">no-repeat</xsl:attribute>
827 <xsl:attribute name="background-position-horizontal">center</xsl:attribute>
828 <xsl:attribute name="background-position-vertical">center</xsl:attribute>
829 </xsl:if>
830 </fo:region-body>
831 <fo:region-before region-name="xsl-region-before-first"
832 extent="{$region.before.extent}"
833 display-align="before"/>
834 <fo:region-after region-name="xsl-region-after-first"
835 extent="{$region.after.extent}"
836 display-align="after"/>
837 </fo:simple-page-master>
838
839 <fo:simple-page-master master-name="front-odd-draft"
840 page-width="{$page.width}"
841 page-height="{$page.height}"
842 margin-top="{$page.margin.top}"
843 margin-bottom="{$page.margin.bottom}"
844 margin-left="{$margin.left.inner}"
845 margin-right="{$page.margin.outer}">
846 <xsl:if test="$axf.extensions != 0">
847 <xsl:call-template name="axf-page-master-properties">
848 <xsl:with-param name="page.master">front-odd-draft</xsl:with-param>
849 </xsl:call-template>
850 </xsl:if>
851 <fo:region-body margin-bottom="{$body.margin.bottom}"
852 margin-top="{$body.margin.top}"
853 column-gap="{$column.gap.front}"
854 column-count="{$column.count.front}">
855 <xsl:if test="$draft.watermark.image != ''">
856 <xsl:attribute name="background-image">
857 <xsl:call-template name="fo-external-image">
858 <xsl:with-param name="filename" select="$draft.watermark.image"/>
859 </xsl:call-template>
860 </xsl:attribute>
861 <xsl:attribute name="background-attachment">fixed</xsl:attribute>
862 <xsl:attribute name="background-repeat">no-repeat</xsl:attribute>
863 <xsl:attribute name="background-position-horizontal">center</xsl:attribute>
864 <xsl:attribute name="background-position-vertical">center</xsl:attribute>
865 </xsl:if>
866 </fo:region-body>
867 <fo:region-before region-name="xsl-region-before-odd"
868 extent="{$region.before.extent}"
869 display-align="before"/>
870 <fo:region-after region-name="xsl-region-after-odd"
871 extent="{$region.after.extent}"
872 display-align="after"/>
873 </fo:simple-page-master>
874
875 <fo:simple-page-master master-name="front-even-draft"
876 page-width="{$page.width}"
877 page-height="{$page.height}"
878 margin-top="{$page.margin.top}"
879 margin-bottom="{$page.margin.bottom}"
880 margin-left="{$margin.left.outer}"
881 margin-right="{$page.margin.inner}">
882 <xsl:if test="$axf.extensions != 0">
883 <xsl:call-template name="axf-page-master-properties">
884 <xsl:with-param name="page.master">front-even-draft</xsl:with-param>
885 </xsl:call-template>
886 </xsl:if>
887 <fo:region-body margin-bottom="{$body.margin.bottom}"
888 margin-top="{$body.margin.top}"
889 column-gap="{$column.gap.front}"
890 column-count="{$column.count.front}">
891 <xsl:if test="$draft.watermark.image != ''">
892 <xsl:attribute name="background-image">
893 <xsl:call-template name="fo-external-image">
894 <xsl:with-param name="filename" select="$draft.watermark.image"/>
895 </xsl:call-template>
896 </xsl:attribute>
897 <xsl:attribute name="background-attachment">fixed</xsl:attribute>
898 <xsl:attribute name="background-repeat">no-repeat</xsl:attribute>
899 <xsl:attribute name="background-position-horizontal">center</xsl:attribute>
900 <xsl:attribute name="background-position-vertical">center</xsl:attribute>
901 </xsl:if>
902 </fo:region-body>
903 <fo:region-before region-name="xsl-region-before-even"
904 extent="{$region.before.extent}"
905 display-align="before"/>
906 <fo:region-after region-name="xsl-region-after-even"
907 extent="{$region.after.extent}"
908 display-align="after"/>
909 </fo:simple-page-master>
910
911 <!-- draft body pages -->
912 <fo:simple-page-master master-name="body-first-draft"
913 page-width="{$page.width}"
914 page-height="{$page.height}"
915 margin-top="{$page.margin.top}"
916 margin-bottom="{$page.margin.bottom}"
917 margin-left="{$margin.left.inner}"
918 margin-right="{$page.margin.outer}">
919 <xsl:if test="$axf.extensions != 0">
920 <xsl:call-template name="axf-page-master-properties">
921 <xsl:with-param name="page.master">body-first-draft</xsl:with-param>
922 </xsl:call-template>
923 </xsl:if>
924 <fo:region-body margin-bottom="{$body.margin.bottom}"
925 margin-top="{$body.margin.top}"
926 column-gap="{$column.gap.body}"
927 column-count="{$column.count.body}">
928 <xsl:if test="$draft.watermark.image != ''">
929 <xsl:attribute name="background-image">
930 <xsl:call-template name="fo-external-image">
931 <xsl:with-param name="filename" select="$draft.watermark.image"/>
932 </xsl:call-template>
933 </xsl:attribute>
934 <xsl:attribute name="background-attachment">fixed</xsl:attribute>
935 <xsl:attribute name="background-repeat">no-repeat</xsl:attribute>
936 <xsl:attribute name="background-position-horizontal">center</xsl:attribute>
937 <xsl:attribute name="background-position-vertical">center</xsl:attribute>
938 </xsl:if>
939 </fo:region-body>
940 <fo:region-before region-name="xsl-region-before-first"
941 extent="{$region.before.extent}"
942 display-align="before"/>
943 <fo:region-after region-name="xsl-region-after-first"
944 extent="{$region.after.extent}"
945 display-align="after"/>
946 </fo:simple-page-master>
947
948 <fo:simple-page-master master-name="body-odd-draft"
949 page-width="{$page.width}"
950 page-height="{$page.height}"
951 margin-top="{$page.margin.top}"
952 margin-bottom="{$page.margin.bottom}"
953 margin-left="{$margin.left.inner}"
954 margin-right="{$page.margin.outer}">
955 <xsl:if test="$axf.extensions != 0">
956 <xsl:call-template name="axf-page-master-properties">
957 <xsl:with-param name="page.master">body-odd-draft</xsl:with-param>
958 </xsl:call-template>
959 </xsl:if>
960 <fo:region-body margin-bottom="{$body.margin.bottom}"
961 margin-top="{$body.margin.top}"
962 column-gap="{$column.gap.body}"
963 column-count="{$column.count.body}">
964 <xsl:if test="$draft.watermark.image != ''">
965 <xsl:attribute name="background-image">
966 <xsl:call-template name="fo-external-image">
967 <xsl:with-param name="filename" select="$draft.watermark.image"/>
968 </xsl:call-template>
969 </xsl:attribute>
970 <xsl:attribute name="background-attachment">fixed</xsl:attribute>
971 <xsl:attribute name="background-repeat">no-repeat</xsl:attribute>
972 <xsl:attribute name="background-position-horizontal">center</xsl:attribute>
973 <xsl:attribute name="background-position-vertical">center</xsl:attribute>
974 </xsl:if>
975 </fo:region-body>
976 <fo:region-before region-name="xsl-region-before-odd"
977 extent="{$region.before.extent}"
978 display-align="before"/>
979 <fo:region-after region-name="xsl-region-after-odd"
980 extent="{$region.after.extent}"
981 display-align="after"/>
982 </fo:simple-page-master>
983
984 <fo:simple-page-master master-name="body-even-draft"
985 page-width="{$page.width}"
986 page-height="{$page.height}"
987 margin-top="{$page.margin.top}"
988 margin-bottom="{$page.margin.bottom}"
989 margin-left="{$margin.left.outer}"
990 margin-right="{$page.margin.inner}">
991 <xsl:if test="$axf.extensions != 0">
992 <xsl:call-template name="axf-page-master-properties">
993 <xsl:with-param name="page.master">body-even-draft</xsl:with-param>
994 </xsl:call-template>
995 </xsl:if>
996 <fo:region-body margin-bottom="{$body.margin.bottom}"
997 margin-top="{$body.margin.top}"
998 column-gap="{$column.gap.body}"
999 column-count="{$column.count.body}">
1000 <xsl:if test="$draft.watermark.image != ''">
1001 <xsl:attribute name="background-image">
1002 <xsl:call-template name="fo-external-image">
1003 <xsl:with-param name="filename" select="$draft.watermark.image"/>
1004 </xsl:call-template>
1005 </xsl:attribute>
1006 <xsl:attribute name="background-attachment">fixed</xsl:attribute>
1007 <xsl:attribute name="background-repeat">no-repeat</xsl:attribute>
1008 <xsl:attribute name="background-position-horizontal">center</xsl:attribute>
1009 <xsl:attribute name="background-position-vertical">center</xsl:attribute>
1010 </xsl:if>
1011 </fo:region-body>
1012 <fo:region-before region-name="xsl-region-before-even"
1013 extent="{$region.before.extent}"
1014 display-align="before"/>
1015 <fo:region-after region-name="xsl-region-after-even"
1016 extent="{$region.after.extent}"
1017 display-align="after"/>
1018 </fo:simple-page-master>
1019
1020 <!-- draft backmatter pages -->
1021 <fo:simple-page-master master-name="back-first-draft"
1022 page-width="{$page.width}"
1023 page-height="{$page.height}"
1024 margin-top="{$page.margin.top}"
1025 margin-bottom="{$page.margin.bottom}"
1026 margin-left="{$margin.left.inner}"
1027 margin-right="{$page.margin.outer}">
1028 <xsl:if test="$axf.extensions != 0">
1029 <xsl:call-template name="axf-page-master-properties">
1030 <xsl:with-param name="page.master">back-first-draft</xsl:with-param>
1031 </xsl:call-template>
1032 </xsl:if>
1033 <fo:region-body margin-bottom="{$body.margin.bottom}"
1034 margin-top="{$body.margin.top}"
1035 column-gap="{$column.gap.back}"
1036 column-count="{$column.count.back}">
1037 <xsl:if test="$draft.watermark.image != ''">
1038 <xsl:attribute name="background-image">
1039 <xsl:call-template name="fo-external-image">
1040 <xsl:with-param name="filename" select="$draft.watermark.image"/>
1041 </xsl:call-template>
1042 </xsl:attribute>
1043 <xsl:attribute name="background-attachment">fixed</xsl:attribute>
1044 <xsl:attribute name="background-repeat">no-repeat</xsl:attribute>
1045 <xsl:attribute name="background-position-horizontal">center</xsl:attribute>
1046 <xsl:attribute name="background-position-vertical">center</xsl:attribute>
1047 </xsl:if>
1048 </fo:region-body>
1049 <fo:region-before region-name="xsl-region-before-first"
1050 extent="{$region.before.extent}"
1051 display-align="before"/>
1052 <fo:region-after region-name="xsl-region-after-first"
1053 extent="{$region.after.extent}"
1054 display-align="after"/>
1055 </fo:simple-page-master>
1056
1057 <fo:simple-page-master master-name="back-odd-draft"
1058 page-width="{$page.width}"
1059 page-height="{$page.height}"
1060 margin-top="{$page.margin.top}"
1061 margin-bottom="{$page.margin.bottom}"
1062 margin-left="{$margin.left.inner}"
1063 margin-right="{$page.margin.outer}">
1064 <xsl:if test="$axf.extensions != 0">
1065 <xsl:call-template name="axf-page-master-properties">
1066 <xsl:with-param name="page.master">back-odd-draft</xsl:with-param>
1067 </xsl:call-template>
1068 </xsl:if>
1069 <fo:region-body margin-bottom="{$body.margin.bottom}"
1070 margin-top="{$body.margin.top}"
1071 column-gap="{$column.gap.back}"
1072 column-count="{$column.count.back}">
1073 <xsl:if test="$draft.watermark.image != ''">
1074 <xsl:attribute name="background-image">
1075 <xsl:call-template name="fo-external-image">
1076 <xsl:with-param name="filename" select="$draft.watermark.image"/>
1077 </xsl:call-template>
1078 </xsl:attribute>
1079 <xsl:attribute name="background-attachment">fixed</xsl:attribute>
1080 <xsl:attribute name="background-repeat">no-repeat</xsl:attribute>
1081 <xsl:attribute name="background-position-horizontal">center</xsl:attribute>
1082 <xsl:attribute name="background-position-vertical">center</xsl:attribute>
1083 </xsl:if>
1084 </fo:region-body>
1085 <fo:region-before region-name="xsl-region-before-odd"
1086 extent="{$region.before.extent}"
1087 display-align="before"/>
1088 <fo:region-after region-name="xsl-region-after-odd"
1089 extent="{$region.after.extent}"
1090 display-align="after"/>
1091 </fo:simple-page-master>
1092
1093 <fo:simple-page-master master-name="back-even-draft"
1094 page-width="{$page.width}"
1095 page-height="{$page.height}"
1096 margin-top="{$page.margin.top}"
1097 margin-bottom="{$page.margin.bottom}"
1098 margin-left="{$margin.left.outer}"
1099 margin-right="{$page.margin.inner}">
1100 <xsl:if test="$axf.extensions != 0">
1101 <xsl:call-template name="axf-page-master-properties">
1102 <xsl:with-param name="page.master">back-even-draft</xsl:with-param>
1103 </xsl:call-template>
1104 </xsl:if>
1105 <fo:region-body margin-bottom="{$body.margin.bottom}"
1106 margin-top="{$body.margin.top}"
1107 column-gap="{$column.gap.back}"
1108 column-count="{$column.count.back}">
1109 <xsl:if test="$draft.watermark.image != ''">
1110 <xsl:attribute name="background-image">
1111 <xsl:call-template name="fo-external-image">
1112 <xsl:with-param name="filename" select="$draft.watermark.image"/>
1113 </xsl:call-template>
1114 </xsl:attribute>
1115 <xsl:attribute name="background-attachment">fixed</xsl:attribute>
1116 <xsl:attribute name="background-repeat">no-repeat</xsl:attribute>
1117 <xsl:attribute name="background-position-horizontal">center</xsl:attribute>
1118 <xsl:attribute name="background-position-vertical">center</xsl:attribute>
1119 </xsl:if>
1120 </fo:region-body>
1121 <fo:region-before region-name="xsl-region-before-even"
1122 extent="{$region.before.extent}"
1123 display-align="before"/>
1124 <fo:region-after region-name="xsl-region-after-even"
1125 extent="{$region.after.extent}"
1126 display-align="after"/>
1127 </fo:simple-page-master>
1128
1129 <!-- draft index pages -->
1130 <fo:simple-page-master master-name="index-first-draft"
1131 page-width="{$page.width}"
1132 page-height="{$page.height}"
1133 margin-top="{$page.margin.top}"
1134 margin-bottom="{$page.margin.bottom}"
1135 margin-left="{$page.margin.inner}"
1136 margin-right="{$page.margin.outer}">
1137 <xsl:if test="$axf.extensions != 0">
1138 <xsl:call-template name="axf-page-master-properties">
1139 <xsl:with-param name="page.master">index-first-draft</xsl:with-param>
1140 </xsl:call-template>
1141 </xsl:if>
1142 <fo:region-body margin-bottom="{$body.margin.bottom}"
1143 margin-top="{$body.margin.top}"
1144 column-gap="{$column.gap.index}"
1145 column-count="{$column.count.index}">
1146 <xsl:if test="$draft.watermark.image != ''">
1147 <xsl:attribute name="background-image">
1148 <xsl:call-template name="fo-external-image">
1149 <xsl:with-param name="filename" select="$draft.watermark.image"/>
1150 </xsl:call-template>
1151 </xsl:attribute>
1152 <xsl:attribute name="background-attachment">fixed</xsl:attribute>
1153 <xsl:attribute name="background-repeat">no-repeat</xsl:attribute>
1154 <xsl:attribute name="background-position-horizontal">center</xsl:attribute>
1155 <xsl:attribute name="background-position-vertical">center</xsl:attribute>
1156 </xsl:if>
1157 </fo:region-body>
1158 <fo:region-before region-name="xsl-region-before-first"
1159 extent="{$region.before.extent}"
1160 display-align="before"/>
1161 <fo:region-after region-name="xsl-region-after-first"
1162 extent="{$region.after.extent}"
1163 display-align="after"/>
1164 </fo:simple-page-master>
1165
1166 <fo:simple-page-master master-name="index-odd-draft"
1167 page-width="{$page.width}"
1168 page-height="{$page.height}"
1169 margin-top="{$page.margin.top}"
1170 margin-bottom="{$page.margin.bottom}"
1171 margin-left="{$page.margin.inner}"
1172 margin-right="{$page.margin.outer}">
1173 <xsl:if test="$axf.extensions != 0">
1174 <xsl:call-template name="axf-page-master-properties">
1175 <xsl:with-param name="page.master">index-odd-draft</xsl:with-param>
1176 </xsl:call-template>
1177 </xsl:if>
1178 <fo:region-body margin-bottom="{$body.margin.bottom}"
1179 margin-top="{$body.margin.top}"
1180 column-gap="{$column.gap.index}"
1181 column-count="{$column.count.index}">
1182 <xsl:if test="$draft.watermark.image != ''">
1183 <xsl:attribute name="background-image">
1184 <xsl:call-template name="fo-external-image">
1185 <xsl:with-param name="filename" select="$draft.watermark.image"/>
1186 </xsl:call-template>
1187 </xsl:attribute>
1188 <xsl:attribute name="background-attachment">fixed</xsl:attribute>
1189 <xsl:attribute name="background-repeat">no-repeat</xsl:attribute>
1190 <xsl:attribute name="background-position-horizontal">center</xsl:attribute>
1191 <xsl:attribute name="background-position-vertical">center</xsl:attribute>
1192 </xsl:if>
1193 </fo:region-body>
1194 <fo:region-before region-name="xsl-region-before-odd"
1195 extent="{$region.before.extent}"
1196 display-align="before"/>
1197 <fo:region-after region-name="xsl-region-after-odd"
1198 extent="{$region.after.extent}"
1199 display-align="after"/>
1200 </fo:simple-page-master>
1201
1202 <fo:simple-page-master master-name="index-even-draft"
1203 page-width="{$page.width}"
1204 page-height="{$page.height}"
1205 margin-top="{$page.margin.top}"
1206 margin-bottom="{$page.margin.bottom}"
1207 margin-right="{$page.margin.inner}"
1208 margin-left="{$page.margin.outer}">
1209 <xsl:if test="$axf.extensions != 0">
1210 <xsl:call-template name="axf-page-master-properties">
1211 <xsl:with-param name="page.master">index-even-draft</xsl:with-param>
1212 </xsl:call-template>
1213 </xsl:if>
1214 <fo:region-body margin-bottom="{$body.margin.bottom}"
1215 margin-top="{$body.margin.top}"
1216 column-gap="{$column.gap.index}"
1217 column-count="{$column.count.index}">
1218 <xsl:if test="$draft.watermark.image != ''">
1219 <xsl:attribute name="background-image">
1220 <xsl:call-template name="fo-external-image">
1221 <xsl:with-param name="filename" select="$draft.watermark.image"/>
1222 </xsl:call-template>
1223 </xsl:attribute>
1224 <xsl:attribute name="background-attachment">fixed</xsl:attribute>
1225 <xsl:attribute name="background-repeat">no-repeat</xsl:attribute>
1226 <xsl:attribute name="background-position-horizontal">center</xsl:attribute>
1227 <xsl:attribute name="background-position-vertical">center</xsl:attribute>
1228 </xsl:if>
1229 </fo:region-body>
1230 <fo:region-before region-name="xsl-region-before-even"
1231 extent="{$region.before.extent}"
1232 display-align="before"/>
1233 <fo:region-after region-name="xsl-region-after-even"
1234 extent="{$region.after.extent}"
1235 display-align="after"/>
1236 </fo:simple-page-master>
1237 </xsl:if>
1238
1239 <!-- setup for title page(s) -->
1240 <fo:page-sequence-master master-name="titlepage">
1241 <fo:repeatable-page-master-alternatives>
1242 <fo:conditional-page-master-reference master-reference="blank"
1243 blank-or-not-blank="blank"/>
1244 <fo:conditional-page-master-reference master-reference="titlepage-first"
1245 page-position="first"/>
1246 <fo:conditional-page-master-reference master-reference="titlepage-odd"
1247 odd-or-even="odd"/>
1248 <fo:conditional-page-master-reference
1249 odd-or-even="even">
1250 <xsl:attribute name="master-reference">
1251 <xsl:choose>
1252 <xsl:when test="$double.sided != 0">titlepage-even</xsl:when>
1253 <xsl:otherwise>titlepage-odd</xsl:otherwise>
1254 </xsl:choose>
1255 </xsl:attribute>
1256 </fo:conditional-page-master-reference>
1257 </fo:repeatable-page-master-alternatives>
1258 </fo:page-sequence-master>
1259
1260 <!-- setup for lots -->
1261 <fo:page-sequence-master master-name="lot">
1262 <fo:repeatable-page-master-alternatives>
1263 <fo:conditional-page-master-reference master-reference="blank"
1264 blank-or-not-blank="blank"/>
1265 <fo:conditional-page-master-reference master-reference="lot-first"
1266 page-position="first"/>
1267 <fo:conditional-page-master-reference master-reference="lot-odd"
1268 odd-or-even="odd"/>
1269 <fo:conditional-page-master-reference
1270 odd-or-even="even">
1271 <xsl:attribute name="master-reference">
1272 <xsl:choose>
1273 <xsl:when test="$double.sided != 0">lot-even</xsl:when>
1274 <xsl:otherwise>lot-odd</xsl:otherwise>
1275 </xsl:choose>
1276 </xsl:attribute>
1277 </fo:conditional-page-master-reference>
1278 </fo:repeatable-page-master-alternatives>
1279 </fo:page-sequence-master>
1280
1281 <!-- setup front matter -->
1282 <fo:page-sequence-master master-name="front">
1283 <fo:repeatable-page-master-alternatives>
1284 <fo:conditional-page-master-reference master-reference="blank"
1285 blank-or-not-blank="blank"/>
1286 <fo:conditional-page-master-reference master-reference="front-first"
1287 page-position="first"/>
1288 <fo:conditional-page-master-reference master-reference="front-odd"
1289 odd-or-even="odd"/>
1290 <fo:conditional-page-master-reference
1291 odd-or-even="even">
1292 <xsl:attribute name="master-reference">
1293 <xsl:choose>
1294 <xsl:when test="$double.sided != 0">front-even</xsl:when>
1295 <xsl:otherwise>front-odd</xsl:otherwise>
1296 </xsl:choose>
1297 </xsl:attribute>
1298 </fo:conditional-page-master-reference>
1299 </fo:repeatable-page-master-alternatives>
1300 </fo:page-sequence-master>
1301
1302 <!-- setup for body pages -->
1303 <fo:page-sequence-master master-name="body">
1304 <fo:repeatable-page-master-alternatives>
1305 <fo:conditional-page-master-reference master-reference="blank"
1306 blank-or-not-blank="blank"/>
1307 <fo:conditional-page-master-reference master-reference="body-first"
1308 page-position="first"/>
1309 <fo:conditional-page-master-reference master-reference="body-odd"
1310 odd-or-even="odd"/>
1311 <fo:conditional-page-master-reference
1312 odd-or-even="even">
1313 <xsl:attribute name="master-reference">
1314 <xsl:choose>
1315 <xsl:when test="$double.sided != 0">body-even</xsl:when>
1316 <xsl:otherwise>body-odd</xsl:otherwise>
1317 </xsl:choose>
1318 </xsl:attribute>
1319 </fo:conditional-page-master-reference>
1320 </fo:repeatable-page-master-alternatives>
1321 </fo:page-sequence-master>
1322
1323 <!-- setup back matter -->
1324 <fo:page-sequence-master master-name="back">
1325 <fo:repeatable-page-master-alternatives>
1326 <fo:conditional-page-master-reference master-reference="blank"
1327 blank-or-not-blank="blank"/>
1328 <fo:conditional-page-master-reference master-reference="back-first"
1329 page-position="first"/>
1330 <fo:conditional-page-master-reference master-reference="back-odd"
1331 odd-or-even="odd"/>
1332 <fo:conditional-page-master-reference
1333 odd-or-even="even">
1334 <xsl:attribute name="master-reference">
1335 <xsl:choose>
1336 <xsl:when test="$double.sided != 0">back-even</xsl:when>
1337 <xsl:otherwise>back-odd</xsl:otherwise>
1338 </xsl:choose>
1339 </xsl:attribute>
1340 </fo:conditional-page-master-reference>
1341 </fo:repeatable-page-master-alternatives>
1342 </fo:page-sequence-master>
1343
1344 <!-- setup back matter -->
1345 <fo:page-sequence-master master-name="index">
1346 <fo:repeatable-page-master-alternatives>
1347 <fo:conditional-page-master-reference master-reference="blank"
1348 blank-or-not-blank="blank"/>
1349 <fo:conditional-page-master-reference master-reference="index-first"
1350 page-position="first"/>
1351 <fo:conditional-page-master-reference master-reference="index-odd"
1352 odd-or-even="odd"/>
1353 <fo:conditional-page-master-reference
1354 odd-or-even="even">
1355 <xsl:attribute name="master-reference">
1356 <xsl:choose>
1357 <xsl:when test="$double.sided != 0">index-even</xsl:when>
1358 <xsl:otherwise>index-odd</xsl:otherwise>
1359 </xsl:choose>
1360 </xsl:attribute>
1361 </fo:conditional-page-master-reference>
1362 </fo:repeatable-page-master-alternatives>
1363 </fo:page-sequence-master>
1364
1365 <xsl:if test="$draft.mode != 'no'">
1366 <!-- setup for draft title page(s) -->
1367 <fo:page-sequence-master master-name="titlepage-draft">
1368 <fo:repeatable-page-master-alternatives>
1369 <fo:conditional-page-master-reference master-reference="blank-draft"
1370 blank-or-not-blank="blank"/>
1371 <fo:conditional-page-master-reference master-reference="titlepage-first-draft"
1372 page-position="first"/>
1373 <fo:conditional-page-master-reference master-reference="titlepage-odd-draft"
1374 odd-or-even="odd"/>
1375 <fo:conditional-page-master-reference
1376 odd-or-even="even">
1377 <xsl:attribute name="master-reference">
1378 <xsl:choose>
1379 <xsl:when test="$double.sided != 0">titlepage-even-draft</xsl:when>
1380 <xsl:otherwise>titlepage-odd-draft</xsl:otherwise>
1381 </xsl:choose>
1382 </xsl:attribute>
1383 </fo:conditional-page-master-reference>
1384 </fo:repeatable-page-master-alternatives>
1385 </fo:page-sequence-master>
1386
1387 <!-- setup for draft lots -->
1388 <fo:page-sequence-master master-name="lot-draft">
1389 <fo:repeatable-page-master-alternatives>
1390 <fo:conditional-page-master-reference master-reference="blank-draft"
1391 blank-or-not-blank="blank"/>
1392 <fo:conditional-page-master-reference master-reference="lot-first-draft"
1393 page-position="first"/>
1394 <fo:conditional-page-master-reference master-reference="lot-odd-draft"
1395 odd-or-even="odd"/>
1396 <fo:conditional-page-master-reference
1397 odd-or-even="even">
1398 <xsl:attribute name="master-reference">
1399 <xsl:choose>
1400 <xsl:when test="$double.sided != 0">lot-even-draft</xsl:when>
1401 <xsl:otherwise>lot-odd-draft</xsl:otherwise>
1402 </xsl:choose>
1403 </xsl:attribute>
1404 </fo:conditional-page-master-reference>
1405 </fo:repeatable-page-master-alternatives>
1406 </fo:page-sequence-master>
1407
1408 <!-- setup draft front matter -->
1409 <fo:page-sequence-master master-name="front-draft">
1410 <fo:repeatable-page-master-alternatives>
1411 <fo:conditional-page-master-reference master-reference="blank-draft"
1412 blank-or-not-blank="blank"/>
1413 <fo:conditional-page-master-reference master-reference="front-first-draft"
1414 page-position="first"/>
1415 <fo:conditional-page-master-reference master-reference="front-odd-draft"
1416 odd-or-even="odd"/>
1417 <fo:conditional-page-master-reference
1418 odd-or-even="even">
1419 <xsl:attribute name="master-reference">
1420 <xsl:choose>
1421 <xsl:when test="$double.sided != 0">front-even-draft</xsl:when>
1422 <xsl:otherwise>front-odd-draft</xsl:otherwise>
1423 </xsl:choose>
1424 </xsl:attribute>
1425 </fo:conditional-page-master-reference>
1426 </fo:repeatable-page-master-alternatives>
1427 </fo:page-sequence-master>
1428
1429 <!-- setup for draft body pages -->
1430 <fo:page-sequence-master master-name="body-draft">
1431 <fo:repeatable-page-master-alternatives>
1432 <fo:conditional-page-master-reference master-reference="blank-draft"
1433 blank-or-not-blank="blank"/>
1434 <fo:conditional-page-master-reference master-reference="body-first-draft"
1435 page-position="first"/>
1436 <fo:conditional-page-master-reference master-reference="body-odd-draft"
1437 odd-or-even="odd"/>
1438 <fo:conditional-page-master-reference
1439 odd-or-even="even">
1440 <xsl:attribute name="master-reference">
1441 <xsl:choose>
1442 <xsl:when test="$double.sided != 0">body-even-draft</xsl:when>
1443 <xsl:otherwise>body-odd-draft</xsl:otherwise>
1444 </xsl:choose>
1445 </xsl:attribute>
1446 </fo:conditional-page-master-reference>
1447 </fo:repeatable-page-master-alternatives>
1448 </fo:page-sequence-master>
1449
1450 <!-- setup draft back matter -->
1451 <fo:page-sequence-master master-name="back-draft">
1452 <fo:repeatable-page-master-alternatives>
1453 <fo:conditional-page-master-reference master-reference="blank-draft"
1454 blank-or-not-blank="blank"/>
1455 <fo:conditional-page-master-reference master-reference="back-first-draft"
1456 page-position="first"/>
1457 <fo:conditional-page-master-reference master-reference="back-odd-draft"
1458 odd-or-even="odd"/>
1459 <fo:conditional-page-master-reference
1460 odd-or-even="even">
1461 <xsl:attribute name="master-reference">
1462 <xsl:choose>
1463 <xsl:when test="$double.sided != 0">back-even-draft</xsl:when>
1464 <xsl:otherwise>back-odd-draft</xsl:otherwise>
1465 </xsl:choose>
1466 </xsl:attribute>
1467 </fo:conditional-page-master-reference>
1468 </fo:repeatable-page-master-alternatives>
1469 </fo:page-sequence-master>
1470
1471 <!-- setup draft index pages -->
1472 <fo:page-sequence-master master-name="index-draft">
1473 <fo:repeatable-page-master-alternatives>
1474 <fo:conditional-page-master-reference master-reference="blank-draft"
1475 blank-or-not-blank="blank"/>
1476 <fo:conditional-page-master-reference master-reference="index-first-draft"
1477 page-position="first"/>
1478 <fo:conditional-page-master-reference master-reference="index-odd-draft"
1479 odd-or-even="odd"/>
1480 <fo:conditional-page-master-reference
1481 odd-or-even="even">
1482 <xsl:attribute name="master-reference">
1483 <xsl:choose>
1484 <xsl:when test="$double.sided != 0">index-even-draft</xsl:when>
1485 <xsl:otherwise>index-odd-draft</xsl:otherwise>
1486 </xsl:choose>
1487 </xsl:attribute>
1488 </fo:conditional-page-master-reference>
1489 </fo:repeatable-page-master-alternatives>
1490 </fo:page-sequence-master>
1491 </xsl:if>
1492
1493 <xsl:call-template name="user.pagemasters"/>
1494
1495 </fo:layout-master-set>
1496</xsl:template>
1497
1498<!-- ==================================================================== -->
1499
1500<xsl:template name="user.pagemasters"/> <!-- intentionally empty -->
1501
1502<!-- ==================================================================== -->
1503
1504<xsl:template name="select.pagemaster">
1505 <xsl:param name="element" select="local-name(.)"/>
1506 <xsl:param name="pageclass" select="''"/>
1507
1508 <xsl:variable name="pagemaster">
1509 <xsl:choose>
1510 <xsl:when test="$pageclass != ''">
1511 <xsl:value-of select="$pageclass"/>
1512 </xsl:when>
1513 <xsl:when test="$pageclass = 'lot'">lot</xsl:when>
1514 <xsl:when test="$element = 'dedication'">front</xsl:when>
1515 <xsl:when test="$element = 'preface'">front</xsl:when>
1516 <xsl:when test="$element = 'appendix'">back</xsl:when>
1517 <xsl:when test="$element = 'glossary'">back</xsl:when>
1518 <xsl:when test="$element = 'bibliography'">back</xsl:when>
1519 <xsl:when test="$element = 'index'">index</xsl:when>
1520 <xsl:when test="$element = 'colophon'">back</xsl:when>
1521 <xsl:otherwise>body</xsl:otherwise>
1522 </xsl:choose>
1523
1524 <xsl:choose>
1525 <xsl:when test="$draft.mode = 'yes'">
1526 <xsl:text>-draft</xsl:text>
1527 </xsl:when>
1528 <xsl:when test="$draft.mode = 'no'">
1529 <!-- nop -->
1530 </xsl:when>
1531 <xsl:when test="ancestor-or-self::*[@status][1]/@status = 'draft'">
1532 <xsl:text>-draft</xsl:text>
1533 </xsl:when>
1534 <xsl:otherwise>
1535 <!-- nop -->
1536 </xsl:otherwise>
1537 </xsl:choose>
1538 </xsl:variable>
1539
1540 <xsl:call-template name="select.user.pagemaster">
1541 <xsl:with-param name="element" select="$element"/>
1542 <xsl:with-param name="pageclass" select="$pageclass"/>
1543 <xsl:with-param name="default-pagemaster" select="$pagemaster"/>
1544 </xsl:call-template>
1545</xsl:template>
1546
1547<xsl:template name="select.user.pagemaster">
1548 <xsl:param name="element"/>
1549 <xsl:param name="pageclass"/>
1550 <xsl:param name="default-pagemaster"/>
1551
1552 <!-- by default, return the default. But if you've created your own
1553 pagemasters in user.pagemasters, you might want to select one here. -->
1554 <xsl:value-of select="$default-pagemaster"/>
1555</xsl:template>
1556
1557<!-- ==================================================================== -->
1558
1559<xsl:template name="head.sep.rule">
1560 <xsl:param name="pageclass"/>
1561 <xsl:param name="sequence"/>
1562 <xsl:param name="gentext-key"/>
1563
1564 <xsl:if test="$header.rule != 0">
1565 <xsl:attribute name="border-bottom-width">0.5pt</xsl:attribute>
1566 <xsl:attribute name="border-bottom-style">solid</xsl:attribute>
1567 <xsl:attribute name="border-bottom-color">black</xsl:attribute>
1568 </xsl:if>
1569</xsl:template>
1570
1571<xsl:template name="foot.sep.rule">
1572 <xsl:param name="pageclass"/>
1573 <xsl:param name="sequence"/>
1574 <xsl:param name="gentext-key"/>
1575
1576 <xsl:if test="$footer.rule != 0">
1577 <xsl:attribute name="border-top-width">0.5pt</xsl:attribute>
1578 <xsl:attribute name="border-top-style">solid</xsl:attribute>
1579 <xsl:attribute name="border-top-color">black</xsl:attribute>
1580 </xsl:if>
1581</xsl:template>
1582
1583<!-- ==================================================================== -->
1584
1585<xsl:template match="*" mode="running.head.mode">
1586 <xsl:param name="master-reference" select="'unknown'"/>
1587 <xsl:param name="gentext-key" select="local-name(.)"/>
1588
1589 <!-- remove -draft from reference -->
1590 <xsl:variable name="pageclass">
1591 <xsl:choose>
1592 <xsl:when test="contains($master-reference, '-draft')">
1593 <xsl:value-of select="substring-before($master-reference, '-draft')"/>
1594 </xsl:when>
1595 <xsl:otherwise>
1596 <xsl:value-of select="$master-reference"/>
1597 </xsl:otherwise>
1598 </xsl:choose>
1599 </xsl:variable>
1600
1601 <fo:static-content flow-name="xsl-region-before-first">
1602 <fo:block xsl:use-attribute-sets="header.content.properties">
1603 <xsl:call-template name="header.table">
1604 <xsl:with-param name="pageclass" select="$pageclass"/>
1605 <xsl:with-param name="sequence" select="'first'"/>
1606 <xsl:with-param name="gentext-key" select="$gentext-key"/>
1607 </xsl:call-template>
1608 </fo:block>
1609 </fo:static-content>
1610
1611 <fo:static-content flow-name="xsl-region-before-odd">
1612 <fo:block xsl:use-attribute-sets="header.content.properties">
1613 <xsl:call-template name="header.table">
1614 <xsl:with-param name="pageclass" select="$pageclass"/>
1615 <xsl:with-param name="sequence" select="'odd'"/>
1616 <xsl:with-param name="gentext-key" select="$gentext-key"/>
1617 </xsl:call-template>
1618 </fo:block>
1619 </fo:static-content>
1620
1621 <fo:static-content flow-name="xsl-region-before-even">
1622 <fo:block xsl:use-attribute-sets="header.content.properties">
1623 <xsl:call-template name="header.table">
1624 <xsl:with-param name="pageclass" select="$pageclass"/>
1625 <xsl:with-param name="sequence" select="'even'"/>
1626 <xsl:with-param name="gentext-key" select="$gentext-key"/>
1627 </xsl:call-template>
1628 </fo:block>
1629 </fo:static-content>
1630
1631 <fo:static-content flow-name="xsl-region-before-blank">
1632 <fo:block xsl:use-attribute-sets="header.content.properties">
1633 <xsl:call-template name="header.table">
1634 <xsl:with-param name="pageclass" select="$pageclass"/>
1635 <xsl:with-param name="sequence" select="'blank'"/>
1636 <xsl:with-param name="gentext-key" select="$gentext-key"/>
1637 </xsl:call-template>
1638 </fo:block>
1639 </fo:static-content>
1640
1641 <xsl:call-template name="footnote-separator"/>
1642
1643 <xsl:if test="$fop.extensions = 0 and $fop1.extensions = 0">
1644 <xsl:call-template name="blank.page.content"/>
1645 </xsl:if>
1646</xsl:template>
1647
1648<xsl:template name="footnote-separator">
1649 <fo:static-content flow-name="xsl-footnote-separator">
1650 <fo:block>
1651 <fo:leader xsl:use-attribute-sets="footnote.sep.leader.properties"/>
1652 </fo:block>
1653 </fo:static-content>
1654</xsl:template>
1655
1656<xsl:template name="blank.page.content">
1657 <fo:static-content flow-name="blank-body">
1658 <fo:block text-align="center"/>
1659 </fo:static-content>
1660</xsl:template>
1661
1662<xsl:template name="header.table">
1663 <xsl:param name="pageclass" select="''"/>
1664 <xsl:param name="sequence" select="''"/>
1665 <xsl:param name="gentext-key" select="''"/>
1666
1667 <!-- default is a single table style for all headers -->
1668 <!-- Customize it for different page classes or sequence location -->
1669
1670 <xsl:choose>
1671 <xsl:when test="$pageclass = 'index'">
1672 <xsl:attribute name="margin-left">0pt</xsl:attribute>
1673 </xsl:when>
1674 </xsl:choose>
1675
1676 <xsl:variable name="column1">
1677 <xsl:choose>
1678 <xsl:when test="$double.sided = 0">1</xsl:when>
1679 <xsl:when test="$sequence = 'first' or $sequence = 'odd'">1</xsl:when>
1680 <xsl:otherwise>3</xsl:otherwise>
1681 </xsl:choose>
1682 </xsl:variable>
1683
1684 <xsl:variable name="column3">
1685 <xsl:choose>
1686 <xsl:when test="$double.sided = 0">3</xsl:when>
1687 <xsl:when test="$sequence = 'first' or $sequence = 'odd'">3</xsl:when>
1688 <xsl:otherwise>1</xsl:otherwise>
1689 </xsl:choose>
1690 </xsl:variable>
1691
1692 <xsl:variable name="candidate">
1693 <fo:table xsl:use-attribute-sets="header.table.properties">
1694 <xsl:call-template name="head.sep.rule">
1695 <xsl:with-param name="pageclass" select="$pageclass"/>
1696 <xsl:with-param name="sequence" select="$sequence"/>
1697 <xsl:with-param name="gentext-key" select="$gentext-key"/>
1698 </xsl:call-template>
1699
1700 <fo:table-column column-number="1">
1701 <xsl:attribute name="column-width">
1702 <xsl:text>proportional-column-width(</xsl:text>
1703 <xsl:call-template name="header.footer.width">
1704 <xsl:with-param name="location">header</xsl:with-param>
1705 <xsl:with-param name="position" select="$column1"/>
1706 </xsl:call-template>
1707 <xsl:text>)</xsl:text>
1708 </xsl:attribute>
1709 </fo:table-column>
1710 <fo:table-column column-number="2">
1711 <xsl:attribute name="column-width">
1712 <xsl:text>proportional-column-width(</xsl:text>
1713 <xsl:call-template name="header.footer.width">
1714 <xsl:with-param name="location">header</xsl:with-param>
1715 <xsl:with-param name="position" select="2"/>
1716 </xsl:call-template>
1717 <xsl:text>)</xsl:text>
1718 </xsl:attribute>
1719 </fo:table-column>
1720 <fo:table-column column-number="3">
1721 <xsl:attribute name="column-width">
1722 <xsl:text>proportional-column-width(</xsl:text>
1723 <xsl:call-template name="header.footer.width">
1724 <xsl:with-param name="location">header</xsl:with-param>
1725 <xsl:with-param name="position" select="$column3"/>
1726 </xsl:call-template>
1727 <xsl:text>)</xsl:text>
1728 </xsl:attribute>
1729 </fo:table-column>
1730
1731 <fo:table-body>
1732 <fo:table-row>
1733 <xsl:attribute name="block-progression-dimension.minimum">
1734 <xsl:value-of select="$header.table.height"/>
1735 </xsl:attribute>
1736 <fo:table-cell text-align="left"
1737 display-align="before">
1738 <xsl:if test="$fop.extensions = 0">
1739 <xsl:attribute name="relative-align">baseline</xsl:attribute>
1740 </xsl:if>
1741 <fo:block>
1742 <xsl:call-template name="header.content">
1743 <xsl:with-param name="pageclass" select="$pageclass"/>
1744 <xsl:with-param name="sequence" select="$sequence"/>
1745 <xsl:with-param name="position" select="'left'"/>
1746 <xsl:with-param name="gentext-key" select="$gentext-key"/>
1747 </xsl:call-template>
1748 </fo:block>
1749 </fo:table-cell>
1750 <fo:table-cell text-align="center"
1751 display-align="before">
1752 <xsl:if test="$fop.extensions = 0">
1753 <xsl:attribute name="relative-align">baseline</xsl:attribute>
1754 </xsl:if>
1755 <fo:block>
1756 <xsl:call-template name="header.content">
1757 <xsl:with-param name="pageclass" select="$pageclass"/>
1758 <xsl:with-param name="sequence" select="$sequence"/>
1759 <xsl:with-param name="position" select="'center'"/>
1760 <xsl:with-param name="gentext-key" select="$gentext-key"/>
1761 </xsl:call-template>
1762 </fo:block>
1763 </fo:table-cell>
1764 <fo:table-cell text-align="right"
1765 display-align="before">
1766 <xsl:if test="$fop.extensions = 0">
1767 <xsl:attribute name="relative-align">baseline</xsl:attribute>
1768 </xsl:if>
1769 <fo:block>
1770 <xsl:call-template name="header.content">
1771 <xsl:with-param name="pageclass" select="$pageclass"/>
1772 <xsl:with-param name="sequence" select="$sequence"/>
1773 <xsl:with-param name="position" select="'right'"/>
1774 <xsl:with-param name="gentext-key" select="$gentext-key"/>
1775 </xsl:call-template>
1776 </fo:block>
1777 </fo:table-cell>
1778 </fo:table-row>
1779 </fo:table-body>
1780 </fo:table>
1781 </xsl:variable>
1782
1783 <!-- Really output a header? -->
1784 <xsl:choose>
1785 <xsl:when test="$pageclass = 'titlepage' and $gentext-key = 'book'
1786 and $sequence='first'">
1787 <!-- no, book titlepages have no headers at all -->
1788 </xsl:when>
1789 <xsl:when test="$sequence = 'blank' and $headers.on.blank.pages = 0">
1790 <!-- no output -->
1791 </xsl:when>
1792 <xsl:otherwise>
1793 <xsl:copy-of select="$candidate"/>
1794 </xsl:otherwise>
1795 </xsl:choose>
1796</xsl:template>
1797
1798<xsl:template name="header.content">
1799 <xsl:param name="pageclass" select="''"/>
1800 <xsl:param name="sequence" select="''"/>
1801 <xsl:param name="position" select="''"/>
1802 <xsl:param name="gentext-key" select="''"/>
1803
1804<!--
1805 <fo:block>
1806 <xsl:value-of select="$pageclass"/>
1807 <xsl:text>, </xsl:text>
1808 <xsl:value-of select="$sequence"/>
1809 <xsl:text>, </xsl:text>
1810 <xsl:value-of select="$position"/>
1811 <xsl:text>, </xsl:text>
1812 <xsl:value-of select="$gentext-key"/>
1813 </fo:block>
1814-->
1815
1816 <fo:block>
1817
1818 <!-- sequence can be odd, even, first, blank -->
1819 <!-- position can be left, center, right -->
1820 <xsl:choose>
1821 <xsl:when test="$sequence = 'blank'">
1822 <!-- nothing -->
1823 </xsl:when>
1824
1825 <xsl:when test="$position='left'">
1826 <!-- Same for odd, even, empty, and blank sequences -->
1827 <xsl:call-template name="draft.text"/>
1828 </xsl:when>
1829
1830 <xsl:when test="($sequence='odd' or $sequence='even') and $position='center'">
1831 <xsl:if test="$pageclass != 'titlepage'">
1832 <xsl:choose>
1833 <xsl:when test="ancestor::book and ($double.sided != 0)">
1834 <fo:retrieve-marker retrieve-class-name="section.head.marker"
1835 retrieve-position="first-including-carryover"
1836 retrieve-boundary="page-sequence"/>
1837 </xsl:when>
1838 <xsl:otherwise>
1839 <xsl:apply-templates select="." mode="titleabbrev.markup"/>
1840 </xsl:otherwise>
1841 </xsl:choose>
1842 </xsl:if>
1843 </xsl:when>
1844
1845 <xsl:when test="$position='center'">
1846 <!-- nothing for empty and blank sequences -->
1847 </xsl:when>
1848
1849 <xsl:when test="$position='right'">
1850 <!-- Same for odd, even, empty, and blank sequences -->
1851 <xsl:call-template name="draft.text"/>
1852 </xsl:when>
1853
1854 <xsl:when test="$sequence = 'first'">
1855 <!-- nothing for first pages -->
1856 </xsl:when>
1857
1858 <xsl:when test="$sequence = 'blank'">
1859 <!-- nothing for blank pages -->
1860 </xsl:when>
1861 </xsl:choose>
1862 </fo:block>
1863</xsl:template>
1864
1865<xsl:template name="header.footer.width">
1866 <xsl:param name="location" select="'header'"/>
1867 <xsl:param name="position" select="1"/>
1868
1869 <xsl:variable name="width.set">
1870 <xsl:choose>
1871 <xsl:when test="$location = 'header'">
1872 <xsl:value-of select="normalize-space($header.column.widths)"/>
1873 </xsl:when>
1874 <xsl:otherwise>
1875 <xsl:value-of select="normalize-space($footer.column.widths)"/>
1876 </xsl:otherwise>
1877 </xsl:choose>
1878 </xsl:variable>
1879
1880
1881 <xsl:variable name="width">
1882 <xsl:choose>
1883 <xsl:when test="$position = 1">
1884 <xsl:value-of select="substring-before($width.set, ' ')"/>
1885 </xsl:when>
1886 <xsl:when test="$position = 2">
1887 <xsl:value-of select="substring-before(substring-after($width.set, ' '), ' ')"/>
1888 </xsl:when>
1889 <xsl:otherwise>
1890 <xsl:value-of select="substring-after(substring-after($width.set, ' '), ' ')"/>
1891 </xsl:otherwise>
1892 </xsl:choose>
1893 </xsl:variable>
1894
1895 <!-- Make sure it is a number -->
1896 <xsl:choose>
1897 <xsl:when test = "$width = number($width)">
1898 <xsl:value-of select="$width"/>
1899 </xsl:when>
1900 <xsl:otherwise>
1901 <xsl:message>Error: value in <xsl:value-of select="$location"/>.column.widths at position <xsl:value-of select="$position"/> is not a number.</xsl:message>
1902 <xsl:text>1</xsl:text>
1903 </xsl:otherwise>
1904 </xsl:choose>
1905</xsl:template>
1906
1907<xsl:template name="draft.text">
1908 <xsl:choose>
1909 <xsl:when test="$draft.mode = 'yes'">
1910 <xsl:call-template name="gentext">
1911 <xsl:with-param name="key" select="'Draft'"/>
1912 </xsl:call-template>
1913 </xsl:when>
1914 <xsl:when test="$draft.mode = 'no'">
1915 <!-- nop -->
1916 </xsl:when>
1917 <xsl:when test="ancestor-or-self::*[@status][1]/@status = 'draft'">
1918 <xsl:call-template name="gentext">
1919 <xsl:with-param name="key" select="'Draft'"/>
1920 </xsl:call-template>
1921 </xsl:when>
1922 <xsl:otherwise>
1923 <!-- nop -->
1924 </xsl:otherwise>
1925 </xsl:choose>
1926</xsl:template>
1927
1928<!-- ==================================================================== -->
1929
1930<xsl:template match="*" mode="running.foot.mode">
1931 <xsl:param name="master-reference" select="'unknown'"/>
1932 <xsl:param name="gentext-key" select="local-name(.)"/>
1933
1934 <!-- remove -draft from reference -->
1935 <xsl:variable name="pageclass">
1936 <xsl:choose>
1937 <xsl:when test="contains($master-reference, '-draft')">
1938 <xsl:value-of select="substring-before($master-reference, '-draft')"/>
1939 </xsl:when>
1940 <xsl:otherwise>
1941 <xsl:value-of select="$master-reference"/>
1942 </xsl:otherwise>
1943 </xsl:choose>
1944 </xsl:variable>
1945
1946 <fo:static-content flow-name="xsl-region-after-first">
1947 <fo:block xsl:use-attribute-sets="footer.content.properties">
1948 <xsl:call-template name="footer.table">
1949 <xsl:with-param name="pageclass" select="$pageclass"/>
1950 <xsl:with-param name="sequence" select="'first'"/>
1951 <xsl:with-param name="gentext-key" select="$gentext-key"/>
1952 </xsl:call-template>
1953 </fo:block>
1954 </fo:static-content>
1955
1956 <fo:static-content flow-name="xsl-region-after-odd">
1957 <fo:block xsl:use-attribute-sets="footer.content.properties">
1958 <xsl:call-template name="footer.table">
1959 <xsl:with-param name="pageclass" select="$pageclass"/>
1960 <xsl:with-param name="sequence" select="'odd'"/>
1961 <xsl:with-param name="gentext-key" select="$gentext-key"/>
1962 </xsl:call-template>
1963 </fo:block>
1964 </fo:static-content>
1965
1966 <fo:static-content flow-name="xsl-region-after-even">
1967 <fo:block xsl:use-attribute-sets="footer.content.properties">
1968 <xsl:call-template name="footer.table">
1969 <xsl:with-param name="pageclass" select="$pageclass"/>
1970 <xsl:with-param name="sequence" select="'even'"/>
1971 <xsl:with-param name="gentext-key" select="$gentext-key"/>
1972 </xsl:call-template>
1973 </fo:block>
1974 </fo:static-content>
1975
1976 <fo:static-content flow-name="xsl-region-after-blank">
1977 <fo:block xsl:use-attribute-sets="footer.content.properties">
1978 <xsl:call-template name="footer.table">
1979 <xsl:with-param name="pageclass" select="$pageclass"/>
1980 <xsl:with-param name="sequence" select="'blank'"/>
1981 <xsl:with-param name="gentext-key" select="$gentext-key"/>
1982 </xsl:call-template>
1983 </fo:block>
1984 </fo:static-content>
1985</xsl:template>
1986
1987<xsl:template name="footer.table">
1988 <xsl:param name="pageclass" select="''"/>
1989 <xsl:param name="sequence" select="''"/>
1990 <xsl:param name="gentext-key" select="''"/>
1991
1992 <!-- default is a single table style for all footers -->
1993 <!-- Customize it for different page classes or sequence location -->
1994
1995 <xsl:choose>
1996 <xsl:when test="$pageclass = 'index'">
1997 <xsl:attribute name="margin-left">0pt</xsl:attribute>
1998 </xsl:when>
1999 </xsl:choose>
2000
2001 <xsl:variable name="column1">
2002 <xsl:choose>
2003 <xsl:when test="$double.sided = 0">1</xsl:when>
2004 <xsl:when test="$sequence = 'first' or $sequence = 'odd'">1</xsl:when>
2005 <xsl:otherwise>3</xsl:otherwise>
2006 </xsl:choose>
2007 </xsl:variable>
2008
2009 <xsl:variable name="column3">
2010 <xsl:choose>
2011 <xsl:when test="$double.sided = 0">3</xsl:when>
2012 <xsl:when test="$sequence = 'first' or $sequence = 'odd'">3</xsl:when>
2013 <xsl:otherwise>1</xsl:otherwise>
2014 </xsl:choose>
2015 </xsl:variable>
2016
2017 <xsl:variable name="candidate">
2018 <fo:table xsl:use-attribute-sets="footer.table.properties">
2019 <xsl:call-template name="foot.sep.rule">
2020 <xsl:with-param name="pageclass" select="$pageclass"/>
2021 <xsl:with-param name="sequence" select="$sequence"/>
2022 <xsl:with-param name="gentext-key" select="$gentext-key"/>
2023 </xsl:call-template>
2024 <fo:table-column column-number="1">
2025 <xsl:attribute name="column-width">
2026 <xsl:text>proportional-column-width(</xsl:text>
2027 <xsl:call-template name="header.footer.width">
2028 <xsl:with-param name="location">footer</xsl:with-param>
2029 <xsl:with-param name="position" select="$column1"/>
2030 </xsl:call-template>
2031 <xsl:text>)</xsl:text>
2032 </xsl:attribute>
2033 </fo:table-column>
2034 <fo:table-column column-number="2">
2035 <xsl:attribute name="column-width">
2036 <xsl:text>proportional-column-width(</xsl:text>
2037 <xsl:call-template name="header.footer.width">
2038 <xsl:with-param name="location">footer</xsl:with-param>
2039 <xsl:with-param name="position" select="2"/>
2040 </xsl:call-template>
2041 <xsl:text>)</xsl:text>
2042 </xsl:attribute>
2043 </fo:table-column>
2044 <fo:table-column column-number="3">
2045 <xsl:attribute name="column-width">
2046 <xsl:text>proportional-column-width(</xsl:text>
2047 <xsl:call-template name="header.footer.width">
2048 <xsl:with-param name="location">footer</xsl:with-param>
2049 <xsl:with-param name="position" select="$column3"/>
2050 </xsl:call-template>
2051 <xsl:text>)</xsl:text>
2052 </xsl:attribute>
2053 </fo:table-column>
2054
2055 <fo:table-body>
2056 <fo:table-row>
2057 <xsl:attribute name="block-progression-dimension.minimum">
2058 <xsl:value-of select="$footer.table.height"/>
2059 </xsl:attribute>
2060 <fo:table-cell text-align="left"
2061 display-align="after">
2062 <xsl:if test="$fop.extensions = 0">
2063 <xsl:attribute name="relative-align">baseline</xsl:attribute>
2064 </xsl:if>
2065 <fo:block>
2066 <xsl:call-template name="footer.content">
2067 <xsl:with-param name="pageclass" select="$pageclass"/>
2068 <xsl:with-param name="sequence" select="$sequence"/>
2069 <xsl:with-param name="position" select="'left'"/>
2070 <xsl:with-param name="gentext-key" select="$gentext-key"/>
2071 </xsl:call-template>
2072 </fo:block>
2073 </fo:table-cell>
2074 <fo:table-cell text-align="center"
2075 display-align="after">
2076 <xsl:if test="$fop.extensions = 0">
2077 <xsl:attribute name="relative-align">baseline</xsl:attribute>
2078 </xsl:if>
2079 <fo:block>
2080 <xsl:call-template name="footer.content">
2081 <xsl:with-param name="pageclass" select="$pageclass"/>
2082 <xsl:with-param name="sequence" select="$sequence"/>
2083 <xsl:with-param name="position" select="'center'"/>
2084 <xsl:with-param name="gentext-key" select="$gentext-key"/>
2085 </xsl:call-template>
2086 </fo:block>
2087 </fo:table-cell>
2088 <fo:table-cell text-align="right"
2089 display-align="after">
2090 <xsl:if test="$fop.extensions = 0">
2091 <xsl:attribute name="relative-align">baseline</xsl:attribute>
2092 </xsl:if>
2093 <fo:block>
2094 <xsl:call-template name="footer.content">
2095 <xsl:with-param name="pageclass" select="$pageclass"/>
2096 <xsl:with-param name="sequence" select="$sequence"/>
2097 <xsl:with-param name="position" select="'right'"/>
2098 <xsl:with-param name="gentext-key" select="$gentext-key"/>
2099 </xsl:call-template>
2100 </fo:block>
2101 </fo:table-cell>
2102 </fo:table-row>
2103 </fo:table-body>
2104 </fo:table>
2105 </xsl:variable>
2106
2107 <!-- Really output a footer? -->
2108 <xsl:choose>
2109 <xsl:when test="$pageclass='titlepage' and $gentext-key='book'
2110 and $sequence='first'">
2111 <!-- no, book titlepages have no footers at all -->
2112 </xsl:when>
2113 <xsl:when test="$sequence = 'blank' and $footers.on.blank.pages = 0">
2114 <!-- no output -->
2115 </xsl:when>
2116 <xsl:otherwise>
2117 <xsl:copy-of select="$candidate"/>
2118 </xsl:otherwise>
2119 </xsl:choose>
2120</xsl:template>
2121
2122<xsl:template name="footer.content">
2123 <xsl:param name="pageclass" select="''"/>
2124 <xsl:param name="sequence" select="''"/>
2125 <xsl:param name="position" select="''"/>
2126 <xsl:param name="gentext-key" select="''"/>
2127
2128<!--
2129 <fo:block>
2130 <xsl:value-of select="$pageclass"/>
2131 <xsl:text>, </xsl:text>
2132 <xsl:value-of select="$sequence"/>
2133 <xsl:text>, </xsl:text>
2134 <xsl:value-of select="$position"/>
2135 <xsl:text>, </xsl:text>
2136 <xsl:value-of select="$gentext-key"/>
2137 </fo:block>
2138-->
2139
2140 <fo:block>
2141 <!-- pageclass can be front, body, back -->
2142 <!-- sequence can be odd, even, first, blank -->
2143 <!-- position can be left, center, right -->
2144 <xsl:choose>
2145 <xsl:when test="$pageclass = 'titlepage'">
2146 <!-- nop; no footer on title pages -->
2147 </xsl:when>
2148
2149 <xsl:when test="$double.sided != 0 and $sequence = 'even'
2150 and $position='left'">
2151 <fo:page-number/>
2152 </xsl:when>
2153
2154 <xsl:when test="$double.sided != 0 and ($sequence = 'odd' or $sequence = 'first')
2155 and $position='right'">
2156 <fo:page-number/>
2157 </xsl:when>
2158
2159 <xsl:when test="$double.sided = 0 and $position='center'">
2160 <fo:page-number/>
2161 </xsl:when>
2162
2163 <xsl:when test="$sequence='blank'">
2164 <xsl:choose>
2165 <xsl:when test="$double.sided != 0 and $position = 'left'">
2166 <fo:page-number/>
2167 </xsl:when>
2168 <xsl:when test="$double.sided = 0 and $position = 'center'">
2169 <fo:page-number/>
2170 </xsl:when>
2171 <xsl:otherwise>
2172 <!-- nop -->
2173 </xsl:otherwise>
2174 </xsl:choose>
2175 </xsl:when>
2176
2177
2178 <xsl:otherwise>
2179 <!-- nop -->
2180 </xsl:otherwise>
2181 </xsl:choose>
2182 </fo:block>
2183</xsl:template>
2184
2185<!-- ==================================================================== -->
2186
2187<xsl:template name="page.number.format">
2188 <xsl:param name="element" select="local-name(.)"/>
2189 <xsl:param name="master-reference" select="''"/>
2190
2191 <xsl:choose>
2192 <xsl:when test="$element = 'toc' and self::book">i</xsl:when>
2193 <xsl:when test="$element = 'preface'">i</xsl:when>
2194 <xsl:when test="$element = 'dedication'">i</xsl:when>
2195 <xsl:otherwise>1</xsl:otherwise>
2196 </xsl:choose>
2197</xsl:template>
2198
2199<xsl:template name="initial.page.number">
2200 <xsl:param name="element" select="local-name(.)"/>
2201 <xsl:param name="master-reference" select="''"/>
2202
2203 <!-- Select the first content that the stylesheet places
2204 after the TOC -->
2205 <xsl:variable name="first.book.content"
2206 select="ancestor::book/*[
2207 not(self::title or
2208 self::subtitle or
2209 self::titleabbrev or
2210 self::bookinfo or
2211 self::info or
2212 self::dedication or
2213 self::preface or
2214 self::toc or
2215 self::lot)][1]"/>
2216 <xsl:choose>
2217 <!-- double-sided output -->
2218 <xsl:when test="$double.sided != 0">
2219 <xsl:choose>
2220 <xsl:when test="$element = 'toc'">auto-odd</xsl:when>
2221 <xsl:when test="$element = 'book'">1</xsl:when>
2222 <!-- preface typically continues TOC roman numerals -->
2223 <!-- Change page.number.format if not -->
2224 <xsl:when test="$element = 'preface'">auto-odd</xsl:when>
2225 <xsl:when test="($element = 'dedication' or $element = 'article')
2226 and not(preceding::chapter
2227 or preceding::preface
2228 or preceding::appendix
2229 or preceding::article
2230 or preceding::dedication
2231 or parent::part
2232 or parent::reference)">1</xsl:when>
2233 <xsl:when test="generate-id($first.book.content) =
2234 generate-id(.)">1</xsl:when>
2235 <xsl:otherwise>auto-odd</xsl:otherwise>
2236 </xsl:choose>
2237 </xsl:when>
2238
2239 <!-- single-sided output -->
2240 <xsl:otherwise>
2241 <xsl:choose>
2242 <xsl:when test="$element = 'toc'">auto</xsl:when>
2243 <xsl:when test="$element = 'book'">1</xsl:when>
2244 <xsl:when test="$element = 'preface'">auto</xsl:when>
2245 <xsl:when test="($element = 'dedication' or $element = 'article') and
2246 not(preceding::chapter
2247 or preceding::preface
2248 or preceding::appendix
2249 or preceding::article
2250 or preceding::dedication
2251 or parent::part
2252 or parent::reference)">1</xsl:when>
2253 <xsl:when test="generate-id($first.book.content) =
2254 generate-id(.)">1</xsl:when>
2255 <xsl:otherwise>auto</xsl:otherwise>
2256 </xsl:choose>
2257 </xsl:otherwise>
2258 </xsl:choose>
2259</xsl:template>
2260
2261<xsl:template name="force.page.count">
2262 <xsl:param name="element" select="local-name(.)"/>
2263 <xsl:param name="master-reference" select="''"/>
2264
2265 <xsl:choose>
2266 <!-- double-sided output -->
2267 <xsl:when test="$double.sided != 0">end-on-even</xsl:when>
2268 <!-- single-sided output -->
2269 <xsl:otherwise>no-force</xsl:otherwise>
2270 </xsl:choose>
2271</xsl:template>
2272
2273<xsl:template name="set.flow.properties">
2274 <xsl:param name="element" select="local-name(.)"/>
2275 <xsl:param name="master-reference" select="''"/>
2276
2277 <!-- This template is called after each <fo:flow> starts. -->
2278 <!-- Customize this template to set attributes on fo:flow -->
2279
2280 <!-- remove -draft from reference -->
2281 <xsl:variable name="pageclass">
2282 <xsl:choose>
2283 <xsl:when test="contains($master-reference, '-draft')">
2284 <xsl:value-of select="substring-before($master-reference, '-draft')"/>
2285 </xsl:when>
2286 <xsl:otherwise>
2287 <xsl:value-of select="$master-reference"/>
2288 </xsl:otherwise>
2289 </xsl:choose>
2290 </xsl:variable>
2291
2292 <xsl:choose>
2293 <xsl:when test="$fop.extensions != 0 or $passivetex.extensions != 0">
2294 <!-- body.start.indent does not work well with these processors -->
2295 </xsl:when>
2296 <xsl:when test="starts-with($pageclass, 'body') or
2297 starts-with($pageclass, 'lot') or
2298 starts-with($pageclass, 'front') or
2299 $element = 'preface' or
2300 (starts-with($pageclass, 'back') and
2301 $element = 'appendix')">
2302 <xsl:attribute name="start-indent">
2303 <xsl:value-of select="$body.start.indent"/>
2304 </xsl:attribute>
2305 <xsl:attribute name="end-indent">
2306 <xsl:value-of select="$body.end.indent"/>
2307 </xsl:attribute>
2308 </xsl:when>
2309 </xsl:choose>
2310
2311</xsl:template>
2312<!-- ==================================================================== -->
2313
2314</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.