going crazy...
[phpeclipse.git] / net.sourceforge.phpeclipse.help / docbook-src / guide / xsl / phpeclipse_pagemaster.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                 version="1.0">
5
6 <xsl:template name="setup.pagemasters">
7   <fo:layout-master-set>
8     <!-- blank pages -->
9     <fo:simple-page-master master-name="blank"
10                            page-width="{$page.width}"
11                            page-height="{$page.height}"
12                            margin-top="{$page.margin.top}"
13                            margin-bottom="{$page.margin.bottom}"
14                            margin-left="{$margin.left.outer}"
15                            margin-right="{$page.margin.inner}">
16       <fo:region-body margin-bottom="{$body.margin.bottom}"
17                       margin-top="{$body.margin.top}"
18                       margin-left="0pt"
19                       margin-right="{$region.side.extent}">
20       </fo:region-body>
21       <fo:region-before region-name="xsl-region-before-blank"
22                         extent="{$region.before.extent}"
23                         precedence="true"
24                         display-align="before"/>
25       <fo:region-after region-name="xsl-region-after-blank"
26                        extent="{$region.after.extent}"
27                        precedence="true"
28                        display-align="after"/>
29       <fo:region-start region-name="xsl-region-start-even"
30                        extent="0pt"/>
31       <fo:region-end region-name="xsl-region-end-even"
32                        extent="{$region.side.extent}"/>
33     </fo:simple-page-master>
34
35     <!-- title pages -->
36     <fo:simple-page-master master-name="titlepage-first"
37                            page-width="{$page.width}"
38                            page-height="{$page.height}"
39                            margin-top="{$page.margin.top}"
40                            margin-bottom="{$page.margin.bottom}"
41                            margin-left="{$margin.left.inner}"
42                            margin-right="{$margin.left.outer}">
43       <fo:region-body margin-bottom="{$body.margin.bottom}"
44                       margin-top="{$body.margin.top}"
45                       margin-left="{$region.side.extent}"
46                       margin-right="0pt"
47                       column-gap="{$column.gap.titlepage}"
48                       column-count="{$column.count.titlepage}">
49       </fo:region-body>
50       <fo:region-before region-name="xsl-region-before-first"
51                         extent="{$region.before.extent}"
52                         precedence="true"
53                         display-align="before"/>
54       <fo:region-after region-name="xsl-region-after-first"
55                        extent="{$region.after.extent}"
56                        precedence="true"
57                        display-align="after"/>
58       <fo:region-start region-name="xsl-region-start-first"
59                        extent="{$region.side.extent}"/>
60       <fo:region-end region-name="xsl-region-end-first"
61                        extent="0pt"/>
62     </fo:simple-page-master>
63
64     <fo:simple-page-master master-name="titlepage-odd"
65                            page-width="{$page.width}"
66                            page-height="{$page.height}"
67                            margin-top="{$page.margin.top}"
68                            margin-bottom="{$page.margin.bottom}"
69                            margin-left="{$margin.left.inner}"
70                            margin-right="{$margin.left.outer}">
71       <fo:region-body margin-bottom="{$body.margin.bottom}"
72                       margin-top="{$body.margin.top}"
73                       margin-left="{$region.side.extent}"
74                       margin-right="0pt"
75                       column-gap="{$column.gap.titlepage}"
76                       column-count="{$column.count.titlepage}">
77       </fo:region-body>
78       <fo:region-before region-name="xsl-region-before-odd"
79                         extent="{$region.before.extent}"
80                         precedence="true"
81                         display-align="before"/>
82       <fo:region-after region-name="xsl-region-after-odd"
83                        extent="{$region.after.extent}"
84                        precedence="true"
85                        display-align="after"/>
86       <fo:region-start region-name="xsl-region-start-odd"
87                        extent="{$region.side.extent}"/>
88       <fo:region-end region-name="xsl-region-end-odd"
89                        extent="0pt"/>
90     </fo:simple-page-master>
91
92     <fo:simple-page-master master-name="titlepage-even"
93                            page-width="{$page.width}"
94                            page-height="{$page.height}"
95                            margin-top="{$page.margin.top}"
96                            margin-bottom="{$page.margin.bottom}"
97                            margin-left="{$margin.left.outer}"
98                            margin-right="{$page.margin.inner}">
99       <fo:region-body margin-bottom="{$body.margin.bottom}"
100                       margin-top="{$body.margin.top}"
101                       margin-left="0pt"
102                       margin-right="{$region.side.extent}"
103                       column-gap="{$column.gap.titlepage}"
104                       column-count="{$column.count.titlepage}">
105       </fo:region-body>
106       <fo:region-before region-name="xsl-region-before-even"
107                         extent="{$region.before.extent}"
108                         precedence="true"
109                         display-align="before"/>
110       <fo:region-after region-name="xsl-region-after-even"
111                        extent="{$region.after.extent}"
112                        precedence="true"
113                        display-align="after"/>
114       <fo:region-start region-name="xsl-region-start-even"
115                        extent="0pt"/>
116       <fo:region-end region-name="xsl-region-end-even"
117                        extent="{$region.side.extent}"/>
118     </fo:simple-page-master>
119
120     <!-- list-of-title pages -->
121     <fo:simple-page-master master-name="lot-first"
122                            page-width="{$page.width}"
123                            page-height="{$page.height}"
124                            margin-top="{$page.margin.top}"
125                            margin-bottom="{$page.margin.bottom}"
126                            margin-left="{$margin.left.inner}"
127                            margin-right="{$margin.left.outer}">
128       <fo:region-body margin-bottom="{$body.margin.bottom}"
129                       margin-top="{$body.margin.top}"
130                       margin-left="{$region.side.extent}"
131                       margin-right="0pt"
132                       column-gap="{$column.gap.lot}"
133                       column-count="{$column.count.lot}">
134       </fo:region-body>
135       <fo:region-before region-name="xsl-region-before-first"
136                         extent="{$region.before.extent}"
137                         precedence="true"
138                         display-align="before"/>
139       <fo:region-after region-name="xsl-region-after-first"
140                        extent="{$region.after.extent}"
141                        precedence="true"
142                        display-align="after"/>
143       <fo:region-start region-name="xsl-region-start-first"
144                        extent="{$region.side.extent}"/>
145       <fo:region-end region-name="xsl-region-end-first"
146                        extent="0pt"/>
147     </fo:simple-page-master>
148
149     <fo:simple-page-master master-name="lot-odd"
150                            page-width="{$page.width}"
151                            page-height="{$page.height}"
152                            margin-top="{$page.margin.top}"
153                            margin-bottom="{$page.margin.bottom}"
154                            margin-left="{$margin.left.inner}"
155                            margin-right="{$margin.left.outer}">
156       <fo:region-body margin-bottom="{$body.margin.bottom}"
157                       margin-top="{$body.margin.top}"
158                       margin-left="{$region.side.extent}"
159                       margin-right="0pt"
160                       column-gap="{$column.gap.lot}"
161                       column-count="{$column.count.lot}">
162       </fo:region-body>
163       <fo:region-before region-name="xsl-region-before-odd"
164                         extent="{$region.before.extent}"
165                         precedence="true"
166                         display-align="before"/>
167       <fo:region-after region-name="xsl-region-after-odd"
168                        extent="{$region.after.extent}"
169                        precedence="true"
170                        display-align="after"/>
171       <fo:region-start region-name="xsl-region-start-odd"
172                        extent="{$region.side.extent}"/>
173       <fo:region-end region-name="xsl-region-end-first"
174                        extent="0pt"/>
175     </fo:simple-page-master>
176
177     <fo:simple-page-master master-name="lot-even"
178                            page-width="{$page.width}"
179                            page-height="{$page.height}"
180                            margin-top="{$page.margin.top}"
181                            margin-bottom="{$page.margin.bottom}"
182                            margin-left="{$margin.left.outer}"
183                            margin-right="{$page.margin.inner}">
184       <fo:region-body margin-bottom="{$body.margin.bottom}"
185                       margin-top="{$body.margin.top}"
186                       margin-left="0pt"
187                       margin-right="{$region.side.extent}"
188                       column-gap="{$column.gap.lot}"
189                       column-count="{$column.count.lot}">
190       </fo:region-body>
191       <fo:region-before region-name="xsl-region-before-even"
192                         extent="{$region.before.extent}"
193                         precedence="true"
194                         display-align="before"/>
195       <fo:region-after region-name="xsl-region-after-even"
196                        extent="{$region.after.extent}"
197                        precedence="true"
198                        display-align="after"/>
199       <fo:region-start region-name="xsl-region-start-even"
200                        extent="0pt"/>
201       <fo:region-end region-name="xsl-region-end-even"
202                        extent="{$region.side.extent}"/>
203     </fo:simple-page-master>
204
205     <!-- frontmatter pages -->
206     <fo:simple-page-master master-name="front-first"
207                            page-width="{$page.width}"
208                            page-height="{$page.height}"
209                            margin-top="{$page.margin.top}"
210                            margin-bottom="{$page.margin.bottom}"
211                            margin-left="{$margin.left.inner}"
212                            margin-right="{$margin.left.outer}">
213       <fo:region-body margin-bottom="{$body.margin.bottom}"
214                       margin-top="{$body.margin.top}"
215                       margin-left="{$region.side.extent}"
216                       margin-right="0pt"
217                       column-gap="{$column.gap.front}"
218                       column-count="{$column.count.front}">
219       </fo:region-body>
220       <fo:region-before region-name="xsl-region-before-first"
221                         extent="{$region.before.extent}"
222                         precedence="true"
223                         display-align="before"/>
224       <fo:region-after region-name="xsl-region-after-first"
225                        extent="{$region.after.extent}"
226                        precedence="true"
227                        display-align="after"/>
228       <fo:region-start region-name="xsl-region-start-first"
229                        extent="{$region.side.extent}"/>
230       <fo:region-end region-name="xsl-region-end-first"
231                        extent="0pt"/>
232     </fo:simple-page-master>
233
234     <fo:simple-page-master master-name="front-odd"
235                            page-width="{$page.width}"
236                            page-height="{$page.height}"
237                            margin-top="{$page.margin.top}"
238                            margin-bottom="{$page.margin.bottom}"
239                            margin-left="{$margin.left.inner}"
240                            margin-right="{$margin.left.outer}">
241       <fo:region-body margin-bottom="{$body.margin.bottom}"
242                       margin-top="{$body.margin.top}"
243                       margin-left="{$region.side.extent}"
244                       margin-right="0pt"
245                       column-gap="{$column.gap.front}"
246                       column-count="{$column.count.front}">
247       </fo:region-body>
248       <fo:region-before region-name="xsl-region-before-odd"
249                         extent="{$region.before.extent}"
250                         precedence="true"
251                         display-align="before"/>
252       <fo:region-after region-name="xsl-region-after-odd"
253                        extent="{$region.after.extent}"
254                        precedence="true"
255                        display-align="after"/>
256       <fo:region-start region-name="xsl-region-start-odd"
257                        extent="{$region.side.extent}"/>
258       <fo:region-end region-name="xsl-region-end-odd"
259                        extent="0pt"/>
260     </fo:simple-page-master>
261
262     <fo:simple-page-master master-name="front-even"
263                            page-width="{$page.width}"
264                            page-height="{$page.height}"
265                            margin-top="{$page.margin.top}"
266                            margin-bottom="{$page.margin.bottom}"
267                            margin-left="{$margin.left.outer}"
268                            margin-right="{$page.margin.inner}">
269       <fo:region-body margin-bottom="{$body.margin.bottom}"
270                       margin-top="{$body.margin.top}"
271                       margin-left="0pt"
272                       margin-right="{$region.side.extent}"
273                       column-gap="{$column.gap.front}"
274                       column-count="{$column.count.front}">
275       </fo:region-body>
276       <fo:region-before region-name="xsl-region-before-even"
277                         extent="{$region.before.extent}"
278                         precedence="true"
279                         display-align="before"/>
280       <fo:region-after region-name="xsl-region-after-even"
281                        extent="{$region.after.extent}"
282                        precedence="true"
283                        display-align="after"/>
284       <fo:region-start region-name="xsl-region-start-even"
285                        extent="0pt"/>
286       <fo:region-end region-name="xsl-region-end-even"
287                        extent="{$region.side.extent}"/>
288     </fo:simple-page-master>
289
290     <!-- body pages -->
291     <fo:simple-page-master master-name="body-first"
292                            page-width="{$page.width}"
293                            page-height="{$page.height}"
294                            margin-top="{$page.margin.top}"
295                            margin-bottom="{$page.margin.bottom}"
296                            margin-left="{$margin.left.inner}"
297                            margin-right="{$margin.left.outer}">
298       <fo:region-body margin-bottom="{$body.margin.bottom}"
299                       margin-top="{$body.margin.top}"
300                       margin-left="{$region.side.extent}"
301                       margin-right="0pt"
302                       column-gap="{$column.gap.body}"
303                       column-count="{$column.count.body}">
304       </fo:region-body>
305       <fo:region-before region-name="xsl-region-before-first"
306                         extent="{$region.before.extent}"
307                         precedence="true"
308                         display-align="before"/>
309       <fo:region-after region-name="xsl-region-after-first"
310                        extent="{$region.after.extent}"
311                        precedence="true"
312                        display-align="after"/>
313       <fo:region-start region-name="xsl-region-start-first"
314                        extent="{$region.side.extent}"/>
315       <fo:region-end region-name="xsl-region-end-first"
316                        extent="0pt"/>
317     </fo:simple-page-master>
318
319     <fo:simple-page-master master-name="body-odd"
320                            page-width="{$page.width}"
321                            page-height="{$page.height}"
322                            margin-top="{$page.margin.top}"
323                            margin-bottom="{$page.margin.bottom}"
324                            margin-left="{$margin.left.inner}"
325                            margin-right="{$margin.left.outer}">
326       <fo:region-body margin-bottom="{$body.margin.bottom}"
327                       margin-top="{$body.margin.top}"
328                       margin-left="{$region.side.extent}"
329                       margin-right="0pt"
330                       column-gap="{$column.gap.body}"
331                       column-count="{$column.count.body}">
332       </fo:region-body>
333       <fo:region-before region-name="xsl-region-before-odd"
334                         extent="{$region.before.extent}"
335                         precedence="true"
336                         display-align="before"/>
337       <fo:region-after region-name="xsl-region-after-odd"
338                        extent="{$region.after.extent}"
339                        precedence="true"
340                        display-align="after"/>
341       <fo:region-start region-name="xsl-region-start-first"
342                        extent="{$region.side.extent}"/>
343       <fo:region-end region-name="xsl-region-end-first"
344                        extent="0pt"/>
345     </fo:simple-page-master>
346
347     <fo:simple-page-master master-name="body-even"
348                            page-width="{$page.width}"
349                            page-height="{$page.height}"
350                            margin-top="{$page.margin.top}"
351                            margin-bottom="{$page.margin.bottom}"
352                            margin-left="{$margin.left.outer}"
353                            margin-right="{$page.margin.inner}">
354       <fo:region-body margin-bottom="{$body.margin.bottom}"
355                       margin-top="{$body.margin.top}"
356                       margin-left="0pt"
357                       margin-right="{$region.side.extent}"
358                       column-gap="{$column.gap.body}"
359                       column-count="{$column.count.body}">
360       </fo:region-body>
361       <fo:region-before region-name="xsl-region-before-even"
362                         extent="{$region.before.extent}"
363                         precedence="true"
364                         display-align="before"/>
365       <fo:region-after region-name="xsl-region-after-even"
366                        extent="{$region.after.extent}"
367                        precedence="true"
368                        display-align="after"/>
369       <fo:region-start region-name="xsl-region-start-even"
370                        extent="0pt"/>
371       <fo:region-end region-name="xsl-region-end-even"
372                        extent="{$region.side.extent}"/>
373     </fo:simple-page-master>
374
375     <!-- backmatter pages -->
376     <fo:simple-page-master master-name="back-first"
377                            page-width="{$page.width}"
378                            page-height="{$page.height}"
379                            margin-top="{$page.margin.top}"
380                            margin-bottom="{$page.margin.bottom}"
381                            margin-left="{$margin.left.inner}"
382                            margin-right="{$page.margin.outer}">
383       <fo:region-body margin-bottom="{$body.margin.bottom}"
384                       margin-top="{$body.margin.top}"
385                       column-gap="{$column.gap.back}"
386                       column-count="{$column.count.back}">
387       </fo:region-body>
388       <fo:region-before region-name="xsl-region-before-first"
389                         extent="{$region.before.extent}"
390                         display-align="before"/>
391       <fo:region-after region-name="xsl-region-after-first"
392                        extent="{$region.after.extent}"
393                        display-align="after"/>
394     </fo:simple-page-master>
395
396     <fo:simple-page-master master-name="back-odd"
397                            page-width="{$page.width}"
398                            page-height="{$page.height}"
399                            margin-top="{$page.margin.top}"
400                            margin-bottom="{$page.margin.bottom}"
401                            margin-left="{$margin.left.inner}"
402                            margin-right="{$page.margin.outer}">
403       <fo:region-body margin-bottom="{$body.margin.bottom}"
404                       margin-top="{$body.margin.top}"
405                       column-gap="{$column.gap.back}"
406                       column-count="{$column.count.back}">
407       </fo:region-body>
408       <fo:region-before region-name="xsl-region-before-odd"
409                         extent="{$region.before.extent}"
410                         display-align="before"/>
411       <fo:region-after region-name="xsl-region-after-odd"
412                        extent="{$region.after.extent}"
413                        display-align="after"/>
414     </fo:simple-page-master>
415
416     <fo:simple-page-master master-name="back-even"
417                            page-width="{$page.width}"
418                            page-height="{$page.height}"
419                            margin-top="{$page.margin.top}"
420                            margin-bottom="{$page.margin.bottom}"
421                            margin-left="{$margin.left.outer}"
422                            margin-right="{$page.margin.inner}">
423       <fo:region-body margin-bottom="{$body.margin.bottom}"
424                       margin-top="{$body.margin.top}"
425                       column-gap="{$column.gap.back}"
426                       column-count="{$column.count.back}">
427       </fo:region-body>
428       <fo:region-before region-name="xsl-region-before-even"
429                         extent="{$region.before.extent}"
430                         display-align="before"/>
431       <fo:region-after region-name="xsl-region-after-even"
432                        extent="{$region.after.extent}"
433                        display-align="after"/>
434     </fo:simple-page-master>
435
436     <!-- index pages -->
437     <fo:simple-page-master master-name="index-first"
438                            page-width="{$page.width}"
439                            page-height="{$page.height}"
440                            margin-top="{$page.margin.top}"
441                            margin-bottom="{$page.margin.bottom}"
442                            margin-left="{$margin.left.inner}"
443                            margin-right="{$margin.left.outer}">
444       <fo:region-body margin-bottom="{$body.margin.bottom}"
445                       margin-top="{$body.margin.top}"
446                       margin-left="{$region.side.extent}"
447                       margin-right="0pt"
448                       column-gap="{$column.gap.index}"
449                       column-count="{$column.count.index}">
450       </fo:region-body>
451       <fo:region-before region-name="xsl-region-before-first"
452                         extent="{$region.before.extent}"
453                         precedence="true"
454                         display-align="before"/>
455       <fo:region-after region-name="xsl-region-after-first"
456                        extent="{$region.after.extent}"
457                        precedence="true"
458                        display-align="after"/>
459       <fo:region-start region-name="xsl-region-start-first"
460                        extent="{$region.side.extent}"/>
461       <fo:region-end region-name="xsl-region-end-first"
462                        extent="0pt"/>
463     </fo:simple-page-master>
464
465     <fo:simple-page-master master-name="index-odd"
466                            page-width="{$page.width}"
467                            page-height="{$page.height}"
468                            margin-top="{$page.margin.top}"
469                            margin-bottom="{$page.margin.bottom}"
470                            margin-left="{$margin.left.inner}"
471                            margin-right="{$margin.left.outer}">
472       <fo:region-body margin-bottom="{$body.margin.bottom}"
473                       margin-top="{$body.margin.top}"
474                       margin-left="{$region.side.extent}"
475                       margin-right="0pt"
476                       column-gap="{$column.gap.index}"
477                       column-count="{$column.count.index}">
478       </fo:region-body>
479       <fo:region-before region-name="xsl-region-before-odd"
480                         extent="{$region.before.extent}"
481                         precedence="true"
482                         display-align="before"/>
483       <fo:region-after region-name="xsl-region-after-odd"
484                        extent="{$region.after.extent}"
485                        precedence="true"
486                        display-align="after"/>
487       <fo:region-start region-name="xsl-region-start-odd"
488                        extent="{$region.side.extent}"/>
489       <fo:region-end region-name="xsl-region-end-odd"
490                        extent="0pt"/>
491     </fo:simple-page-master>
492
493     <fo:simple-page-master master-name="index-even"
494                            page-width="{$page.width}"
495                            page-height="{$page.height}"
496                            margin-top="{$page.margin.top}"
497                            margin-bottom="{$page.margin.bottom}"
498                            margin-left="{$margin.left.outer}"
499                            margin-right="{$page.margin.inner}">
500       <fo:region-body margin-bottom="{$body.margin.bottom}"
501                       margin-top="{$body.margin.top}"
502                       margin-left="0pt"
503                       margin-right="{$region.side.extent}"
504                       column-gap="{$column.gap.index}"
505                       column-count="{$column.count.index}">
506       </fo:region-body>
507       <fo:region-before region-name="xsl-region-before-even"
508                         extent="{$region.before.extent}"
509                         precedence="true"
510                         display-align="before"/>
511       <fo:region-after region-name="xsl-region-after-even"
512                        extent="{$region.after.extent}"
513                        precedence="true"
514                        display-align="after"/>
515       <fo:region-start region-name="xsl-region-start-even"
516                        extent="0pt"/>
517       <fo:region-end region-name="xsl-region-end-even"
518                        extent="{$region.side.extent}"/>
519     </fo:simple-page-master>
520
521     <xsl:if test="$draft.mode != 'no'">
522       <!-- draft blank pages -->
523       <fo:simple-page-master master-name="blank-draft"
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="{$margin.left.outer}"
529                              margin-right="{$page.margin.inner}">
530         <fo:region-body margin-bottom="{$body.margin.bottom}"
531                         margin-top="{$body.margin.top}">
532           <xsl:if test="$draft.watermark.image != ''">
533             <xsl:attribute name="background-image">
534               <xsl:call-template name="fo-external-image">
535                 <xsl:with-param name="filename" select="$draft.watermark.image"/>
536               </xsl:call-template>
537             </xsl:attribute>
538             <xsl:attribute name="background-attachment">fixed</xsl:attribute>
539             <xsl:attribute name="background-repeat">no-repeat</xsl:attribute>
540             <xsl:attribute name="background-position-horizontal">center</xsl:attribute>
541             <xsl:attribute name="background-position-vertical">center</xsl:attribute>
542           </xsl:if>
543         </fo:region-body>
544         <fo:region-before region-name="xsl-region-before-blank"
545                           extent="{$region.before.extent}"
546                           display-align="before"/>
547         <fo:region-after region-name="xsl-region-after-blank"
548                          extent="{$region.after.extent}"
549                          display-align="after"/>
550       </fo:simple-page-master>
551
552       <!-- draft title pages -->
553       <fo:simple-page-master master-name="titlepage-first-draft"
554                              page-width="{$page.width}"
555                              page-height="{$page.height}"
556                              margin-top="{$page.margin.top}"
557                              margin-bottom="{$page.margin.bottom}"
558                              margin-left="{$margin.left.inner}"
559                              margin-right="{$page.margin.outer}">
560         <fo:region-body margin-bottom="{$body.margin.bottom}"
561                         margin-top="{$body.margin.top}"
562                         column-gap="{$column.gap.titlepage}"
563                         column-count="{$column.count.titlepage}">
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-first"
577                           extent="{$region.before.extent}"
578                           display-align="before"/>
579         <fo:region-after region-name="xsl-region-after-first"
580                          extent="{$region.after.extent}"
581                          display-align="after"/>
582       </fo:simple-page-master>
583
584       <fo:simple-page-master master-name="titlepage-odd-draft"
585                              page-width="{$page.width}"
586                              page-height="{$page.height}"
587                              margin-top="{$page.margin.top}"
588                              margin-bottom="{$page.margin.bottom}"
589                              margin-left="{$margin.left.inner}"
590                              margin-right="{$page.margin.outer}">
591         <fo:region-body margin-bottom="{$body.margin.bottom}"
592                         margin-top="{$body.margin.top}"
593                         column-gap="{$column.gap.titlepage}"
594                         column-count="{$column.count.titlepage}">
595           <xsl:if test="$draft.watermark.image != ''">
596             <xsl:attribute name="background-image">
597               <xsl:call-template name="fo-external-image">
598                 <xsl:with-param name="filename" select="$draft.watermark.image"/>
599               </xsl:call-template>
600             </xsl:attribute>
601             <xsl:attribute name="background-attachment">fixed</xsl:attribute>
602             <xsl:attribute name="background-repeat">no-repeat</xsl:attribute>
603             <xsl:attribute name="background-position-horizontal">center</xsl:attribute>
604             <xsl:attribute name="background-position-vertical">center</xsl:attribute>
605           </xsl:if>
606         </fo:region-body>
607         <fo:region-before region-name="xsl-region-before-odd"
608                           extent="{$region.before.extent}"
609                           display-align="before"/>
610         <fo:region-after region-name="xsl-region-after-odd"
611                          extent="{$region.after.extent}"
612                          display-align="after"/>
613       </fo:simple-page-master>
614
615       <fo:simple-page-master master-name="titlepage-even-draft"
616                              page-width="{$page.width}"
617                              page-height="{$page.height}"
618                              margin-top="{$page.margin.top}"
619                              margin-bottom="{$page.margin.bottom}"
620                              margin-left="{$margin.left.outer}"
621                              margin-right="{$page.margin.inner}">
622         <fo:region-body margin-bottom="{$body.margin.bottom}"
623                         margin-top="{$body.margin.top}"
624                         column-gap="{$column.gap.titlepage}"
625                         column-count="{$column.count.titlepage}">
626           <xsl:if test="$draft.watermark.image != ''">
627             <xsl:attribute name="background-image">
628               <xsl:call-template name="fo-external-image">
629                 <xsl:with-param name="filename" select="$draft.watermark.image"/>
630               </xsl:call-template>
631             </xsl:attribute>
632             <xsl:attribute name="background-attachment">fixed</xsl:attribute>
633             <xsl:attribute name="background-repeat">no-repeat</xsl:attribute>
634             <xsl:attribute name="background-position-horizontal">center</xsl:attribute>
635             <xsl:attribute name="background-position-vertical">center</xsl:attribute>
636           </xsl:if>
637         </fo:region-body>
638         <fo:region-before region-name="xsl-region-before-even"
639                           extent="{$region.before.extent}"
640                           display-align="before"/>
641         <fo:region-after region-name="xsl-region-after-even"
642                          extent="{$region.after.extent}"
643                          display-align="after"/>
644       </fo:simple-page-master>
645
646       <!-- draft list-of-title pages -->
647       <fo:simple-page-master master-name="lot-first-draft"
648                              page-width="{$page.width}"
649                              page-height="{$page.height}"
650                              margin-top="{$page.margin.top}"
651                              margin-bottom="{$page.margin.bottom}"
652                              margin-left="{$margin.left.inner}"
653                              margin-right="{$page.margin.outer}">
654         <fo:region-body margin-bottom="{$body.margin.bottom}"
655                         margin-top="{$body.margin.top}"
656                         column-gap="{$column.gap.lot}"
657                         column-count="{$column.count.lot}">
658           <xsl:if test="$draft.watermark.image != ''">
659             <xsl:attribute name="background-image">
660               <xsl:call-template name="fo-external-image">
661                 <xsl:with-param name="filename" select="$draft.watermark.image"/>
662               </xsl:call-template>
663             </xsl:attribute>
664             <xsl:attribute name="background-attachment">fixed</xsl:attribute>
665             <xsl:attribute name="background-repeat">no-repeat</xsl:attribute>
666             <xsl:attribute name="background-position-horizontal">center</xsl:attribute>
667             <xsl:attribute name="background-position-vertical">center</xsl:attribute>
668           </xsl:if>
669         </fo:region-body>
670         <fo:region-before region-name="xsl-region-before-first"
671                           extent="{$region.before.extent}"
672                           display-align="before"/>
673         <fo:region-after region-name="xsl-region-after-first"
674                          extent="{$region.after.extent}"
675                          display-align="after"/>
676       </fo:simple-page-master>
677
678       <fo:simple-page-master master-name="lot-odd-draft"
679                              page-width="{$page.width}"
680                              page-height="{$page.height}"
681                              margin-top="{$page.margin.top}"
682                              margin-bottom="{$page.margin.bottom}"
683                              margin-left="{$margin.left.inner}"
684                              margin-right="{$page.margin.outer}">
685         <fo:region-body margin-bottom="{$body.margin.bottom}"
686                         margin-top="{$body.margin.top}"
687                         column-gap="{$column.gap.lot}"
688                         column-count="{$column.count.lot}">
689           <xsl:if test="$draft.watermark.image != ''">
690             <xsl:attribute name="background-image">
691               <xsl:call-template name="fo-external-image">
692                 <xsl:with-param name="filename" select="$draft.watermark.image"/>
693               </xsl:call-template>
694             </xsl:attribute>
695             <xsl:attribute name="background-attachment">fixed</xsl:attribute>
696             <xsl:attribute name="background-repeat">no-repeat</xsl:attribute>
697             <xsl:attribute name="background-position-horizontal">center</xsl:attribute>
698             <xsl:attribute name="background-position-vertical">center</xsl:attribute>
699           </xsl:if>
700         </fo:region-body>
701         <fo:region-before region-name="xsl-region-before-odd"
702                           extent="{$region.before.extent}"
703                           display-align="before"/>
704         <fo:region-after region-name="xsl-region-after-odd"
705                          extent="{$region.after.extent}"
706                          display-align="after"/>
707       </fo:simple-page-master>
708
709       <fo:simple-page-master master-name="lot-even-draft"
710                              page-width="{$page.width}"
711                              page-height="{$page.height}"
712                              margin-top="{$page.margin.top}"
713                              margin-bottom="{$page.margin.bottom}"
714                              margin-left="{$margin.left.outer}"
715                              margin-right="{$page.margin.inner}">
716         <fo:region-body margin-bottom="{$body.margin.bottom}"
717                         margin-top="{$body.margin.top}"
718                         column-gap="{$column.gap.lot}"
719                         column-count="{$column.count.lot}">
720           <xsl:if test="$draft.watermark.image != ''">
721             <xsl:attribute name="background-image">
722               <xsl:call-template name="fo-external-image">
723                 <xsl:with-param name="filename" select="$draft.watermark.image"/>
724               </xsl:call-template>
725             </xsl:attribute>
726             <xsl:attribute name="background-attachment">fixed</xsl:attribute>
727             <xsl:attribute name="background-repeat">no-repeat</xsl:attribute>
728             <xsl:attribute name="background-position-horizontal">center</xsl:attribute>
729             <xsl:attribute name="background-position-vertical">center</xsl:attribute>
730           </xsl:if>
731         </fo:region-body>
732         <fo:region-before region-name="xsl-region-before-even"
733                           extent="{$region.before.extent}"
734                           display-align="before"/>
735         <fo:region-after region-name="xsl-region-after-even"
736                          extent="{$region.after.extent}"
737                          display-align="after"/>
738       </fo:simple-page-master>
739
740       <!-- draft frontmatter pages -->
741       <fo:simple-page-master master-name="front-first-draft"
742                              page-width="{$page.width}"
743                              page-height="{$page.height}"
744                              margin-top="{$page.margin.top}"
745                              margin-bottom="{$page.margin.bottom}"
746                              margin-left="{$margin.left.inner}"
747                              margin-right="{$page.margin.outer}">
748         <fo:region-body margin-bottom="{$body.margin.bottom}"
749                         margin-top="{$body.margin.top}"
750                         column-gap="{$column.gap.front}"
751                         column-count="{$column.count.front}">
752           <xsl:if test="$draft.watermark.image != ''">
753             <xsl:attribute name="background-image">
754               <xsl:call-template name="fo-external-image">
755                 <xsl:with-param name="filename" select="$draft.watermark.image"/>
756               </xsl:call-template>
757             </xsl:attribute>
758             <xsl:attribute name="background-attachment">fixed</xsl:attribute>
759             <xsl:attribute name="background-repeat">no-repeat</xsl:attribute>
760             <xsl:attribute name="background-position-horizontal">center</xsl:attribute>
761             <xsl:attribute name="background-position-vertical">center</xsl:attribute>
762           </xsl:if>
763         </fo:region-body>
764         <fo:region-before region-name="xsl-region-before-first"
765                           extent="{$region.before.extent}"
766                           display-align="before"/>
767         <fo:region-after region-name="xsl-region-after-first"
768                          extent="{$region.after.extent}"
769                          display-align="after"/>
770       </fo:simple-page-master>
771
772       <fo:simple-page-master master-name="front-odd-draft"
773                              page-width="{$page.width}"
774                              page-height="{$page.height}"
775                              margin-top="{$page.margin.top}"
776                              margin-bottom="{$page.margin.bottom}"
777                              margin-left="{$margin.left.inner}"
778                              margin-right="{$page.margin.outer}">
779         <fo:region-body margin-bottom="{$body.margin.bottom}"
780                         margin-top="{$body.margin.top}"
781                         column-gap="{$column.gap.front}"
782                         column-count="{$column.count.front}">
783           <xsl:if test="$draft.watermark.image != ''">
784             <xsl:attribute name="background-image">
785               <xsl:call-template name="fo-external-image">
786                 <xsl:with-param name="filename" select="$draft.watermark.image"/>
787               </xsl:call-template>
788             </xsl:attribute>
789             <xsl:attribute name="background-attachment">fixed</xsl:attribute>
790             <xsl:attribute name="background-repeat">no-repeat</xsl:attribute>
791             <xsl:attribute name="background-position-horizontal">center</xsl:attribute>
792             <xsl:attribute name="background-position-vertical">center</xsl:attribute>
793           </xsl:if>
794         </fo:region-body>
795         <fo:region-before region-name="xsl-region-before-odd"
796                           extent="{$region.before.extent}"
797                           display-align="before"/>
798         <fo:region-after region-name="xsl-region-after-odd"
799                          extent="{$region.after.extent}"
800                          display-align="after"/>
801       </fo:simple-page-master>
802
803       <fo:simple-page-master master-name="front-even-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.outer}"
809                              margin-right="{$page.margin.inner}">
810         <fo:region-body margin-bottom="{$body.margin.bottom}"
811                         margin-top="{$body.margin.top}"
812                         column-gap="{$column.gap.front}"
813                         column-count="{$column.count.front}">
814           <xsl:if test="$draft.watermark.image != ''">
815             <xsl:attribute name="background-image">
816               <xsl:call-template name="fo-external-image">
817                 <xsl:with-param name="filename" select="$draft.watermark.image"/>
818               </xsl:call-template>
819             </xsl:attribute>
820             <xsl:attribute name="background-attachment">fixed</xsl:attribute>
821             <xsl:attribute name="background-repeat">no-repeat</xsl:attribute>
822             <xsl:attribute name="background-position-horizontal">center</xsl:attribute>
823             <xsl:attribute name="background-position-vertical">center</xsl:attribute>
824           </xsl:if>
825         </fo:region-body>
826         <fo:region-before region-name="xsl-region-before-even"
827                           extent="{$region.before.extent}"
828                           display-align="before"/>
829         <fo:region-after region-name="xsl-region-after-even"
830                          extent="{$region.after.extent}"
831                          display-align="after"/>
832       </fo:simple-page-master>
833
834       <!-- draft body pages -->
835       <fo:simple-page-master master-name="body-first-draft"
836                              page-width="{$page.width}"
837                              page-height="{$page.height}"
838                              margin-top="{$page.margin.top}"
839                              margin-bottom="{$page.margin.bottom}"
840                              margin-left="{$margin.left.inner}"
841                              margin-right="{$page.margin.outer}">
842         <fo:region-body margin-bottom="{$body.margin.bottom}"
843                         margin-top="{$body.margin.top}"
844                         column-gap="{$column.gap.body}"
845                         column-count="{$column.count.body}">
846           <xsl:if test="$draft.watermark.image != ''">
847             <xsl:attribute name="background-image">
848               <xsl:call-template name="fo-external-image">
849                 <xsl:with-param name="filename" select="$draft.watermark.image"/>
850               </xsl:call-template>
851             </xsl:attribute>
852             <xsl:attribute name="background-attachment">fixed</xsl:attribute>
853             <xsl:attribute name="background-repeat">no-repeat</xsl:attribute>
854             <xsl:attribute name="background-position-horizontal">center</xsl:attribute>
855             <xsl:attribute name="background-position-vertical">center</xsl:attribute>
856           </xsl:if>
857         </fo:region-body>
858         <fo:region-before region-name="xsl-region-before-first"
859                           extent="{$region.before.extent}"
860                           display-align="before"/>
861         <fo:region-after region-name="xsl-region-after-first"
862                          extent="{$region.after.extent}"
863                          display-align="after"/>
864       </fo:simple-page-master>
865
866       <fo:simple-page-master master-name="body-odd-draft"
867                              page-width="{$page.width}"
868                              page-height="{$page.height}"
869                              margin-top="{$page.margin.top}"
870                              margin-bottom="{$page.margin.bottom}"
871                              margin-left="{$margin.left.inner}"
872                              margin-right="{$page.margin.outer}">
873         <fo:region-body margin-bottom="{$body.margin.bottom}"
874                         margin-top="{$body.margin.top}"
875                         column-gap="{$column.gap.body}"
876                         column-count="{$column.count.body}">
877           <xsl:if test="$draft.watermark.image != ''">
878             <xsl:attribute name="background-image">
879               <xsl:call-template name="fo-external-image">
880                 <xsl:with-param name="filename" select="$draft.watermark.image"/>
881               </xsl:call-template>
882             </xsl:attribute>
883             <xsl:attribute name="background-attachment">fixed</xsl:attribute>
884             <xsl:attribute name="background-repeat">no-repeat</xsl:attribute>
885             <xsl:attribute name="background-position-horizontal">center</xsl:attribute>
886             <xsl:attribute name="background-position-vertical">center</xsl:attribute>
887           </xsl:if>
888         </fo:region-body>
889         <fo:region-before region-name="xsl-region-before-odd"
890                           extent="{$region.before.extent}"
891                           display-align="before"/>
892         <fo:region-after region-name="xsl-region-after-odd"
893                          extent="{$region.after.extent}"
894                          display-align="after"/>
895       </fo:simple-page-master>
896
897       <fo:simple-page-master master-name="body-even-draft"
898                              page-width="{$page.width}"
899                              page-height="{$page.height}"
900                              margin-top="{$page.margin.top}"
901                              margin-bottom="{$page.margin.bottom}"
902                              margin-left="{$margin.left.outer}"
903                              margin-right="{$page.margin.inner}">
904         <fo:region-body margin-bottom="{$body.margin.bottom}"
905                         margin-top="{$body.margin.top}"
906                         column-gap="{$column.gap.body}"
907                         column-count="{$column.count.body}">
908           <xsl:if test="$draft.watermark.image != ''">
909             <xsl:attribute name="background-image">
910               <xsl:call-template name="fo-external-image">
911                 <xsl:with-param name="filename" select="$draft.watermark.image"/>
912               </xsl:call-template>
913             </xsl:attribute>
914             <xsl:attribute name="background-attachment">fixed</xsl:attribute>
915             <xsl:attribute name="background-repeat">no-repeat</xsl:attribute>
916             <xsl:attribute name="background-position-horizontal">center</xsl:attribute>
917             <xsl:attribute name="background-position-vertical">center</xsl:attribute>
918           </xsl:if>
919         </fo:region-body>
920         <fo:region-before region-name="xsl-region-before-even"
921                           extent="{$region.before.extent}"
922                           display-align="before"/>
923         <fo:region-after region-name="xsl-region-after-even"
924                          extent="{$region.after.extent}"
925                          display-align="after"/>
926       </fo:simple-page-master>
927
928       <!-- draft backmatter pages -->
929       <fo:simple-page-master master-name="back-first-draft"
930                              page-width="{$page.width}"
931                              page-height="{$page.height}"
932                              margin-top="{$page.margin.top}"
933                              margin-bottom="{$page.margin.bottom}"
934                              margin-left="{$margin.left.inner}"
935                              margin-right="{$page.margin.outer}">
936         <fo:region-body margin-bottom="{$body.margin.bottom}"
937                         margin-top="{$body.margin.top}"
938                         column-gap="{$column.gap.back}"
939                         column-count="{$column.count.back}">
940           <xsl:if test="$draft.watermark.image != ''">
941             <xsl:attribute name="background-image">
942               <xsl:call-template name="fo-external-image">
943                 <xsl:with-param name="filename" select="$draft.watermark.image"/>
944               </xsl:call-template>
945             </xsl:attribute>
946             <xsl:attribute name="background-attachment">fixed</xsl:attribute>
947             <xsl:attribute name="background-repeat">no-repeat</xsl:attribute>
948             <xsl:attribute name="background-position-horizontal">center</xsl:attribute>
949             <xsl:attribute name="background-position-vertical">center</xsl:attribute>
950           </xsl:if>
951         </fo:region-body>
952         <fo:region-before region-name="xsl-region-before-first"
953                           extent="{$region.before.extent}"
954                           display-align="before"/>
955         <fo:region-after region-name="xsl-region-after-first"
956                          extent="{$region.after.extent}"
957                          display-align="after"/>
958       </fo:simple-page-master>
959
960       <fo:simple-page-master master-name="back-odd-draft"
961                              page-width="{$page.width}"
962                              page-height="{$page.height}"
963                              margin-top="{$page.margin.top}"
964                              margin-bottom="{$page.margin.bottom}"
965                              margin-left="{$margin.left.inner}"
966                              margin-right="{$page.margin.outer}">
967         <fo:region-body margin-bottom="{$body.margin.bottom}"
968                         margin-top="{$body.margin.top}"
969                         column-gap="{$column.gap.back}"
970                         column-count="{$column.count.back}">
971           <xsl:if test="$draft.watermark.image != ''">
972             <xsl:attribute name="background-image">
973               <xsl:call-template name="fo-external-image">
974                 <xsl:with-param name="filename" select="$draft.watermark.image"/>
975               </xsl:call-template>
976             </xsl:attribute>
977             <xsl:attribute name="background-attachment">fixed</xsl:attribute>
978             <xsl:attribute name="background-repeat">no-repeat</xsl:attribute>
979             <xsl:attribute name="background-position-horizontal">center</xsl:attribute>
980             <xsl:attribute name="background-position-vertical">center</xsl:attribute>
981           </xsl:if>
982         </fo:region-body>
983         <fo:region-before region-name="xsl-region-before-odd"
984                           extent="{$region.before.extent}"
985                           display-align="before"/>
986         <fo:region-after region-name="xsl-region-after-odd"
987                          extent="{$region.after.extent}"
988                          display-align="after"/>
989       </fo:simple-page-master>
990
991       <fo:simple-page-master master-name="back-even-draft"
992                              page-width="{$page.width}"
993                              page-height="{$page.height}"
994                              margin-top="{$page.margin.top}"
995                              margin-bottom="{$page.margin.bottom}"
996                              margin-left="{$margin.left.outer}"
997                              margin-right="{$page.margin.inner}">
998         <fo:region-body margin-bottom="{$body.margin.bottom}"
999                         margin-top="{$body.margin.top}"
1000                         column-gap="{$column.gap.back}"
1001                         column-count="{$column.count.back}">
1002           <xsl:if test="$draft.watermark.image != ''">
1003             <xsl:attribute name="background-image">
1004               <xsl:call-template name="fo-external-image">
1005                 <xsl:with-param name="filename" select="$draft.watermark.image"/>
1006               </xsl:call-template>
1007             </xsl:attribute>
1008             <xsl:attribute name="background-attachment">fixed</xsl:attribute>
1009             <xsl:attribute name="background-repeat">no-repeat</xsl:attribute>
1010             <xsl:attribute name="background-position-horizontal">center</xsl:attribute>
1011             <xsl:attribute name="background-position-vertical">center</xsl:attribute>
1012           </xsl:if>
1013         </fo:region-body>
1014         <fo:region-before region-name="xsl-region-before-even"
1015                           extent="{$region.before.extent}"
1016                           display-align="before"/>
1017         <fo:region-after region-name="xsl-region-after-even"
1018                          extent="{$region.after.extent}"
1019                          display-align="after"/>
1020       </fo:simple-page-master>
1021
1022       <!-- draft index pages -->
1023       <fo:simple-page-master master-name="index-first-draft"
1024                              page-width="{$page.width}"
1025                              page-height="{$page.height}"
1026                              margin-top="{$page.margin.top}"
1027                              margin-bottom="{$page.margin.bottom}"
1028                              margin-left="{$page.margin.inner}"
1029                              margin-right="{$page.margin.outer}">
1030         <fo:region-body margin-bottom="{$body.margin.bottom}"
1031                         margin-top="{$body.margin.top}"
1032                         column-gap="{$column.gap.index}"
1033                         column-count="{$column.count.index}">
1034           <xsl:if test="$draft.watermark.image != ''">
1035             <xsl:attribute name="background-image">
1036               <xsl:call-template name="fo-external-image">
1037                 <xsl:with-param name="filename" select="$draft.watermark.image"/>
1038               </xsl:call-template>
1039             </xsl:attribute>
1040             <xsl:attribute name="background-attachment">fixed</xsl:attribute>
1041             <xsl:attribute name="background-repeat">no-repeat</xsl:attribute>
1042             <xsl:attribute name="background-position-horizontal">center</xsl:attribute>
1043             <xsl:attribute name="background-position-vertical">center</xsl:attribute>
1044           </xsl:if>
1045         </fo:region-body>
1046         <fo:region-before region-name="xsl-region-before-first"
1047                           extent="{$region.before.extent}"
1048                           display-align="before"/>
1049         <fo:region-after region-name="xsl-region-after-first"
1050                          extent="{$region.after.extent}"
1051                          display-align="after"/>
1052       </fo:simple-page-master>
1053
1054       <fo:simple-page-master master-name="index-odd-draft"
1055                              page-width="{$page.width}"
1056                              page-height="{$page.height}"
1057                              margin-top="{$page.margin.top}"
1058                              margin-bottom="{$page.margin.bottom}"
1059                              margin-left="{$page.margin.inner}"
1060                              margin-right="{$page.margin.outer}">
1061         <fo:region-body margin-bottom="{$body.margin.bottom}"
1062                         margin-top="{$body.margin.top}"
1063                         column-gap="{$column.gap.index}"
1064                         column-count="{$column.count.index}">
1065           <xsl:if test="$draft.watermark.image != ''">
1066             <xsl:attribute name="background-image">
1067               <xsl:call-template name="fo-external-image">
1068                 <xsl:with-param name="filename" select="$draft.watermark.image"/>
1069               </xsl:call-template>
1070             </xsl:attribute>
1071             <xsl:attribute name="background-attachment">fixed</xsl:attribute>
1072             <xsl:attribute name="background-repeat">no-repeat</xsl:attribute>
1073             <xsl:attribute name="background-position-horizontal">center</xsl:attribute>
1074             <xsl:attribute name="background-position-vertical">center</xsl:attribute>
1075           </xsl:if>
1076         </fo:region-body>
1077         <fo:region-before region-name="xsl-region-before-odd"
1078                           extent="{$region.before.extent}"
1079                           display-align="before"/>
1080         <fo:region-after region-name="xsl-region-after-odd"
1081                          extent="{$region.after.extent}"
1082                          display-align="after"/>
1083       </fo:simple-page-master>
1084
1085       <fo:simple-page-master master-name="index-even-draft"
1086                              page-width="{$page.width}"
1087                              page-height="{$page.height}"
1088                              margin-top="{$page.margin.top}"
1089                              margin-bottom="{$page.margin.bottom}"
1090                              margin-right="{$page.margin.inner}"
1091                              margin-left="{$page.margin.outer}">
1092         <fo:region-body margin-bottom="{$body.margin.bottom}"
1093                         margin-top="{$body.margin.top}"
1094                         column-gap="{$column.gap.index}"
1095                         column-count="{$column.count.index}">
1096           <xsl:if test="$draft.watermark.image != ''">
1097             <xsl:attribute name="background-image">
1098               <xsl:call-template name="fo-external-image">
1099                 <xsl:with-param name="filename" select="$draft.watermark.image"/>
1100               </xsl:call-template>
1101             </xsl:attribute>
1102             <xsl:attribute name="background-attachment">fixed</xsl:attribute>
1103             <xsl:attribute name="background-repeat">no-repeat</xsl:attribute>
1104             <xsl:attribute name="background-position-horizontal">center</xsl:attribute>
1105             <xsl:attribute name="background-position-vertical">center</xsl:attribute>
1106           </xsl:if>
1107         </fo:region-body>
1108         <fo:region-before region-name="xsl-region-before-even"
1109                           extent="{$region.before.extent}"
1110                           display-align="before"/>
1111         <fo:region-after region-name="xsl-region-after-even"
1112                          extent="{$region.after.extent}"
1113                          display-align="after"/>
1114       </fo:simple-page-master>
1115     </xsl:if>
1116
1117     <!-- setup for title page(s) -->
1118     <fo:page-sequence-master master-name="titlepage">
1119       <fo:repeatable-page-master-alternatives>
1120         <fo:conditional-page-master-reference master-reference="blank"
1121                                               blank-or-not-blank="blank"/>
1122         <fo:conditional-page-master-reference master-reference="titlepage-first"
1123                                               page-position="first"/>
1124         <fo:conditional-page-master-reference master-reference="titlepage-odd"
1125                                               odd-or-even="odd"/>
1126         <fo:conditional-page-master-reference master-reference="titlepage-even"
1127                                               odd-or-even="even"/>
1128       </fo:repeatable-page-master-alternatives>
1129     </fo:page-sequence-master>
1130
1131     <!-- setup for lots -->
1132     <fo:page-sequence-master master-name="lot">
1133       <fo:repeatable-page-master-alternatives>
1134         <fo:conditional-page-master-reference master-reference="blank"
1135                                               blank-or-not-blank="blank"/>
1136         <fo:conditional-page-master-reference master-reference="lot-first"
1137                                               page-position="first"/>
1138         <fo:conditional-page-master-reference master-reference="lot-odd"
1139                                               odd-or-even="odd"/>
1140         <fo:conditional-page-master-reference master-reference="lot-even"
1141                                               odd-or-even="even"/>
1142       </fo:repeatable-page-master-alternatives>
1143     </fo:page-sequence-master>
1144
1145     <!-- setup front matter -->
1146     <fo:page-sequence-master master-name="front">
1147       <fo:repeatable-page-master-alternatives>
1148         <fo:conditional-page-master-reference master-reference="blank"
1149                                               blank-or-not-blank="blank"/>
1150         <fo:conditional-page-master-reference master-reference="front-first"
1151                                               page-position="first"/>
1152         <fo:conditional-page-master-reference master-reference="front-odd"
1153                                               odd-or-even="odd"/>
1154         <fo:conditional-page-master-reference master-reference="front-even"
1155                                               odd-or-even="even"/>
1156       </fo:repeatable-page-master-alternatives>
1157     </fo:page-sequence-master>
1158
1159     <!-- setup for body pages -->
1160     <fo:page-sequence-master master-name="body">
1161       <fo:repeatable-page-master-alternatives>
1162         <fo:conditional-page-master-reference master-reference="blank"
1163                                               blank-or-not-blank="blank"/>
1164         <fo:conditional-page-master-reference master-reference="body-first"
1165                                               page-position="first"/>
1166         <fo:conditional-page-master-reference master-reference="body-odd"
1167                                               odd-or-even="odd"/>
1168         <fo:conditional-page-master-reference master-reference="body-even"
1169                                               odd-or-even="even"/>
1170       </fo:repeatable-page-master-alternatives>
1171     </fo:page-sequence-master>
1172
1173     <!-- setup back matter -->
1174     <fo:page-sequence-master master-name="back">
1175       <fo:repeatable-page-master-alternatives>
1176         <fo:conditional-page-master-reference master-reference="blank"
1177                                               blank-or-not-blank="blank"/>
1178         <fo:conditional-page-master-reference master-reference="back-first"
1179                                               page-position="first"/>
1180         <fo:conditional-page-master-reference master-reference="back-odd"
1181                                               odd-or-even="odd"/>
1182         <fo:conditional-page-master-reference master-reference="back-even"
1183                                               odd-or-even="even"/>
1184       </fo:repeatable-page-master-alternatives>
1185     </fo:page-sequence-master>
1186
1187     <!-- setup back matter -->
1188     <fo:page-sequence-master master-name="index">
1189       <fo:repeatable-page-master-alternatives>
1190         <fo:conditional-page-master-reference master-reference="blank"
1191                                               blank-or-not-blank="blank"/>
1192         <fo:conditional-page-master-reference master-reference="index-first"
1193                                               page-position="first"/>
1194         <fo:conditional-page-master-reference master-reference="index-odd"
1195                                               odd-or-even="odd"/>
1196         <fo:conditional-page-master-reference master-reference="index-even"
1197                                               odd-or-even="even"/>
1198       </fo:repeatable-page-master-alternatives>
1199     </fo:page-sequence-master>
1200
1201     <xsl:if test="$draft.mode != 'no'">
1202       <!-- setup for draft title page(s) -->
1203       <fo:page-sequence-master master-name="titlepage-draft">
1204         <fo:repeatable-page-master-alternatives>
1205           <fo:conditional-page-master-reference master-reference="blank-draft"
1206                                                 blank-or-not-blank="blank"/>
1207           <fo:conditional-page-master-reference master-reference="titlepage-first-draft"
1208                                                 page-position="first"/>
1209           <fo:conditional-page-master-reference master-reference="titlepage-odd-draft"
1210                                                 odd-or-even="odd"/>
1211           <fo:conditional-page-master-reference master-reference="titlepage-even-draft"
1212                                                 odd-or-even="even"/>
1213         </fo:repeatable-page-master-alternatives>
1214       </fo:page-sequence-master>
1215
1216       <!-- setup for draft lots -->
1217       <fo:page-sequence-master master-name="lot-draft">
1218         <fo:repeatable-page-master-alternatives>
1219           <fo:conditional-page-master-reference master-reference="blank-draft"
1220                                                 blank-or-not-blank="blank"/>
1221           <fo:conditional-page-master-reference master-reference="lot-first-draft"
1222                                                 page-position="first"/>
1223           <fo:conditional-page-master-reference master-reference="lot-odd-draft"
1224                                                 odd-or-even="odd"/>
1225           <fo:conditional-page-master-reference master-reference="lot-even-draft"
1226                                                 odd-or-even="even"/>
1227         </fo:repeatable-page-master-alternatives>
1228       </fo:page-sequence-master>
1229
1230       <!-- setup draft front matter -->
1231       <fo:page-sequence-master master-name="front-draft">
1232         <fo:repeatable-page-master-alternatives>
1233           <fo:conditional-page-master-reference master-reference="blank-draft"
1234                                                 blank-or-not-blank="blank"/>
1235           <fo:conditional-page-master-reference master-reference="front-first-draft"
1236                                                 page-position="first"/>
1237           <fo:conditional-page-master-reference master-reference="front-odd-draft"
1238                                                 odd-or-even="odd"/>
1239           <fo:conditional-page-master-reference master-reference="front-even-draft"
1240                                                 odd-or-even="even"/>
1241         </fo:repeatable-page-master-alternatives>
1242       </fo:page-sequence-master>
1243
1244       <!-- setup for draft body pages -->
1245       <fo:page-sequence-master master-name="body-draft">
1246         <fo:repeatable-page-master-alternatives>
1247           <fo:conditional-page-master-reference master-reference="blank-draft"
1248                                                 blank-or-not-blank="blank"/>
1249           <fo:conditional-page-master-reference master-reference="body-first-draft"
1250                                                 page-position="first"/>
1251           <fo:conditional-page-master-reference master-reference="body-odd-draft"
1252                                                 odd-or-even="odd"/>
1253           <fo:conditional-page-master-reference master-reference="body-even-draft"
1254                                                 odd-or-even="even"/>
1255         </fo:repeatable-page-master-alternatives>
1256       </fo:page-sequence-master>
1257
1258       <!-- setup draft back matter -->
1259       <fo:page-sequence-master master-name="back-draft">
1260         <fo:repeatable-page-master-alternatives>
1261           <fo:conditional-page-master-reference master-reference="blank-draft"
1262                                                 blank-or-not-blank="blank"/>
1263           <fo:conditional-page-master-reference master-reference="back-first-draft"
1264                                                 page-position="first"/>
1265           <fo:conditional-page-master-reference master-reference="back-odd-draft"
1266                                                 odd-or-even="odd"/>
1267           <fo:conditional-page-master-reference master-reference="back-even-draft"
1268                                                 odd-or-even="even"/>
1269         </fo:repeatable-page-master-alternatives>
1270       </fo:page-sequence-master>
1271
1272       <!-- setup draft index pages -->
1273       <fo:page-sequence-master master-name="index-draft">
1274         <fo:repeatable-page-master-alternatives>
1275           <fo:conditional-page-master-reference master-reference="blank-draft"
1276                                                 blank-or-not-blank="blank"/>
1277           <fo:conditional-page-master-reference master-reference="index-first-draft"
1278                                                 page-position="first"/>
1279           <fo:conditional-page-master-reference master-reference="index-odd-draft"
1280                                                 odd-or-even="odd"/>
1281           <fo:conditional-page-master-reference master-reference="index-even-draft"
1282                                                 odd-or-even="even"/>
1283         </fo:repeatable-page-master-alternatives>
1284       </fo:page-sequence-master>
1285     </xsl:if>
1286
1287     <xsl:call-template name="user.pagemasters"/>
1288
1289     </fo:layout-master-set>
1290 </xsl:template>
1291
1292 <!-- ==================================================================== -->
1293
1294 <xsl:template name="head.sep.rule">
1295   <xsl:param name="pageclass"/>
1296   <xsl:param name="sequence"/>
1297   <xsl:param name="gentext-key"/>
1298
1299   <xsl:if test="$header.rule != 0">
1300     <xsl:attribute name="border-bottom-width">0.2pt</xsl:attribute>
1301     <xsl:attribute name="border-bottom-style">solid</xsl:attribute>
1302     <xsl:attribute name="border-bottom-color">black</xsl:attribute>
1303   </xsl:if>
1304 </xsl:template>
1305
1306 <xsl:template name="foot.sep.rule">
1307   <xsl:param name="pageclass"/>
1308   <xsl:param name="sequence"/>
1309   <xsl:param name="gentext-key"/>
1310
1311   <xsl:if test="$footer.rule != 0">
1312     <xsl:attribute name="border-top-width">0.2pt</xsl:attribute>
1313     <xsl:attribute name="border-top-style">solid</xsl:attribute>
1314     <xsl:attribute name="border-top-color">black</xsl:attribute>
1315   </xsl:if>
1316 </xsl:template>
1317
1318 <!-- ==================================================================== -->
1319
1320 <xsl:template match="*" mode="running.head.mode">
1321   <xsl:param name="master-reference" select="'unknown'"/>
1322   <xsl:param name="gentext-key" select="name(.)"/>
1323
1324   <!-- remove -draft from reference -->
1325   <xsl:variable name="pageclass">
1326     <xsl:choose>
1327       <xsl:when test="contains($master-reference, '-draft')">
1328         <xsl:value-of select="substring-before($master-reference, '-draft')"/>
1329       </xsl:when>
1330       <xsl:otherwise>
1331         <xsl:value-of select="$master-reference"/>
1332       </xsl:otherwise>
1333     </xsl:choose>
1334   </xsl:variable>
1335
1336   <fo:static-content flow-name="xsl-region-start-first">
1337     <fo:block xsl:use-attribute-sets="header.content.properties">
1338         <fo:table table-layout="fixed">
1339           <fo:table-column column-number="1" column-width="{$region.side.extent} - {$region.side.margin}"/>
1340           <fo:table-body>
1341             <fo:table-row>
1342               <fo:table-cell text-align="left" display-align="after" background-color="{$sidebar.background.color}" width="{$region.side.extent} - {$region.side.margin}" height="{$page.height} - {$body.margin.bottom} - {$body.margin.top}">
1343                 <fo:block>
1344                 </fo:block>
1345               </fo:table-cell>
1346             </fo:table-row>
1347           </fo:table-body>
1348         </fo:table>
1349     </fo:block>
1350   </fo:static-content>
1351 <!--
1352   <fo:static-content flow-name="xsl-region-start-even">
1353     <fo:block xsl:use-attribute-sets="header.content.properties">
1354     </fo:block>
1355   </fo:static-content>
1356 -->
1357   <fo:static-content flow-name="xsl-region-end-even">
1358     <fo:block xsl:use-attribute-sets="header.content.properties">
1359         <fo:table table-layout="fixed">
1360           <fo:table-column column-number="1" column-width="{$region.side.margin}"/>
1361           <fo:table-column column-number="2" column-width="{$region.side.extent} - {$region.side.margin}"/>
1362           <fo:table-body>
1363             <fo:table-row>
1364               <fo:table-cell width="{$region.side.margin}" height="{$page.height} - {$body.margin.bottom} - {$body.margin.top}">
1365                 <fo:block>
1366                 </fo:block>
1367               </fo:table-cell>
1368               <fo:table-cell background-color="{$sidebar.background.color}" width="{$region.side.extent} - {$region.side.margin}" height="{$page.height} - {$body.margin.bottom} - {$body.margin.top}">
1369                 <fo:block>
1370                 </fo:block>
1371               </fo:table-cell>
1372             </fo:table-row>
1373           </fo:table-body>
1374         </fo:table>
1375     </fo:block>
1376   </fo:static-content>
1377
1378   <fo:static-content flow-name="xsl-region-before-first">
1379     <fo:block xsl:use-attribute-sets="header.content.properties">
1380       <xsl:call-template name="header.table">
1381         <xsl:with-param name="pageclass" select="$pageclass"/>
1382         <xsl:with-param name="sequence" select="'first'"/>
1383         <xsl:with-param name="gentext-key" select="$gentext-key"/>
1384       </xsl:call-template>
1385     </fo:block>
1386   </fo:static-content>
1387
1388   <fo:static-content flow-name="xsl-region-before-odd">
1389     <fo:block xsl:use-attribute-sets="header.content.properties">
1390       <xsl:call-template name="header.table">
1391         <xsl:with-param name="pageclass" select="$pageclass"/>
1392         <xsl:with-param name="sequence" select="'odd'"/>
1393         <xsl:with-param name="gentext-key" select="$gentext-key"/>
1394       </xsl:call-template>
1395     </fo:block>
1396   </fo:static-content>
1397
1398   <fo:static-content flow-name="xsl-region-before-even">
1399     <fo:block xsl:use-attribute-sets="header.content.properties">
1400       <xsl:call-template name="header.table">
1401         <xsl:with-param name="pageclass" select="$pageclass"/>
1402         <xsl:with-param name="sequence" select="'even'"/>
1403         <xsl:with-param name="gentext-key" select="$gentext-key"/>
1404       </xsl:call-template>
1405     </fo:block>
1406   </fo:static-content>
1407
1408   <fo:static-content flow-name="xsl-region-before-blank">
1409     <fo:block xsl:use-attribute-sets="header.content.properties">
1410       <xsl:call-template name="header.table">
1411         <xsl:with-param name="pageclass" select="$pageclass"/>
1412         <xsl:with-param name="sequence" select="'blank'"/>
1413         <xsl:with-param name="gentext-key" select="$gentext-key"/>
1414       </xsl:call-template>
1415     </fo:block>
1416   </fo:static-content>
1417
1418   <xsl:if test="$fop.extensions = 0">
1419     <xsl:call-template name="footnote-separator"/>
1420     <xsl:call-template name="blank.page.content"/>
1421   </xsl:if>
1422 </xsl:template>
1423
1424 <!-- ==================================================================== -->
1425
1426 <xsl:template name="header.table">
1427   <xsl:param name="pageclass" select="''"/>
1428   <xsl:param name="sequence" select="''"/>
1429   <xsl:param name="gentext-key" select="''"/>
1430
1431   <!-- default is a single table style for all headers -->
1432   <!-- Customize it for different page classes or sequence location -->
1433
1434   <xsl:choose>
1435       <xsl:when test="$pageclass = 'index'">
1436           <xsl:attribute name="margin-left">0pt</xsl:attribute>
1437       </xsl:when>
1438   </xsl:choose>
1439
1440   <xsl:variable name="candidate">
1441     <fo:table table-layout="fixed" width="100%">
1442
1443       <xsl:call-template name="head.sep.rule">
1444         <xsl:with-param name="pageclass" select="$pageclass"/>
1445         <xsl:with-param name="sequence" select="$sequence"/>
1446         <xsl:with-param name="gentext-key" select="$gentext-key"/>
1447       </xsl:call-template>
1448
1449       <xsl:choose>
1450         <xsl:when test="$sequence = 'first' or $sequence = 'odd' or $sequence = ''">
1451           <fo:table-column column-number="1" column-width="{$region.side.extent} - {$region.side.margin}"/>
1452           <fo:table-column column-number="2" column-width="proportional-column-width(1)"/>
1453           <fo:table-column column-number="3" column-width="proportional-column-width(1)"/>
1454           <fo:table-column column-number="4" column-width="proportional-column-width(1)"/>
1455         </xsl:when>
1456         <xsl:otherwise>
1457           <fo:table-column column-number="1" column-width="proportional-column-width(1)"/>
1458           <fo:table-column column-number="2" column-width="proportional-column-width(1)"/>
1459           <fo:table-column column-number="3" column-width="proportional-column-width(1)"/>
1460           <fo:table-column column-number="4" column-width="{$region.side.extent} - {$region.side.margin}"/>
1461         </xsl:otherwise>
1462       </xsl:choose>
1463
1464       <fo:table-body>
1465         <fo:table-row height="14pt">
1466           <xsl:choose>
1467             <xsl:when test="$sequence = 'first' or $sequence = 'odd'">
1468               <fo:table-cell text-align="left" background-color="{$sidebar.background.color}">
1469                 <fo:block>
1470                   <fo:inline padding-bottom="2mm"><fo:external-graphic src="img/phpeclipse_header.jpg" width="23mm" height="7.45mm" text-align="center" padding-bottom="2mm"/></fo:inline>
1471                 </fo:block>
1472               </fo:table-cell>
1473             </xsl:when>
1474             <xsl:otherwise>
1475             </xsl:otherwise>
1476           </xsl:choose>
1477
1478           <fo:table-cell text-align="left" display-align="after" padding-start="2mm">
1479             <xsl:if test="$fop.extensions = 0">
1480               <xsl:attribute name="relative-align">baseline</xsl:attribute>
1481             </xsl:if>
1482             <fo:block>
1483               <xsl:call-template name="header.content">
1484                 <xsl:with-param name="pageclass" select="$pageclass"/>
1485                 <xsl:with-param name="sequence" select="$sequence"/>
1486                 <xsl:with-param name="position" select="'left'"/>
1487                 <xsl:with-param name="gentext-key" select="$gentext-key"/>
1488               </xsl:call-template>
1489             </fo:block>
1490           </fo:table-cell>
1491
1492           <fo:table-cell text-align="center" display-align="after" padding="2mm">
1493             <xsl:if test="$fop.extensions = 0">
1494               <xsl:attribute name="relative-align">baseline</xsl:attribute>
1495             </xsl:if>
1496             <fo:block>
1497               <xsl:call-template name="header.content">
1498                 <xsl:with-param name="pageclass" select="$pageclass"/>
1499                 <xsl:with-param name="sequence" select="$sequence"/>
1500                 <xsl:with-param name="position" select="'center'"/>
1501                 <xsl:with-param name="gentext-key" select="$gentext-key"/>
1502               </xsl:call-template>
1503             </fo:block>
1504           </fo:table-cell>
1505
1506           <fo:table-cell text-align="right" display-align="after" padding-end="2mm">
1507             <xsl:if test="$fop.extensions = 0">
1508               <xsl:attribute name="relative-align">baseline</xsl:attribute>
1509             </xsl:if>
1510             <fo:block>
1511               <xsl:call-template name="header.content">
1512                 <xsl:with-param name="pageclass" select="$pageclass"/>
1513                 <xsl:with-param name="sequence" select="$sequence"/>
1514                 <xsl:with-param name="position" select="'right'"/>
1515                 <xsl:with-param name="gentext-key" select="$gentext-key"/>
1516               </xsl:call-template>
1517             </fo:block>
1518           </fo:table-cell>
1519
1520           <xsl:choose>
1521             <xsl:when test="$sequence = 'first' or $sequence = 'odd'">
1522             </xsl:when>
1523             <xsl:otherwise>
1524               <fo:table-cell text-align="left" background-color="{$sidebar.background.color}" >
1525                 <fo:block>
1526                   <fo:inline padding-bottom="2mm"><fo:external-graphic src="img/phpeclipse_header.jpg" width="23mm" height="7.45mm" text-align="center" padding-bottom="2mm"/></fo:inline>
1527                 </fo:block>
1528               </fo:table-cell>
1529             </xsl:otherwise>
1530           </xsl:choose>
1531
1532         </fo:table-row>
1533       </fo:table-body>
1534     </fo:table>
1535   </xsl:variable>
1536
1537   <!-- Really output a header? -->
1538   <xsl:choose>
1539 <!--
1540     <xsl:when test="$pageclass = 'titlepage' and $gentext-key = 'book' and $sequence='first'">
1541       - no, book titlepages have no headers at all -
1542     </xsl:when>
1543 -->
1544     <xsl:when test="$sequence = 'blank' and $headers.on.blank.pages = 0">
1545       <!-- no output -->
1546     </xsl:when>
1547
1548     <xsl:otherwise>
1549       <xsl:copy-of select="$candidate"/>
1550     </xsl:otherwise>
1551   </xsl:choose>
1552 </xsl:template>
1553
1554 <!-- ==================================================================== -->
1555
1556 <xsl:template name="footer.table">
1557   <xsl:param name="pageclass" select="''"/>
1558   <xsl:param name="sequence" select="''"/>
1559   <xsl:param name="gentext-key" select="''"/>
1560
1561   <xsl:choose>
1562       <xsl:when test="$pageclass = 'index'">
1563           <xsl:attribute name="margin-left">0pt</xsl:attribute>
1564       </xsl:when>
1565   </xsl:choose>
1566
1567   <!-- default is a single table style for all footers -->
1568   <!-- Customize it for different page classes or sequence location -->
1569
1570   <xsl:variable name="candidate">
1571     <fo:table table-layout="fixed" width="100%">
1572       <xsl:call-template name="foot.sep.rule">
1573         <xsl:with-param name="pageclass" select="$pageclass"/>
1574         <xsl:with-param name="sequence" select="$sequence"/>
1575         <xsl:with-param name="gentext-key" select="$gentext-key"/>
1576       </xsl:call-template>
1577
1578       <xsl:choose>
1579         <xsl:when test="$sequence = 'first' or $sequence = 'odd'">
1580           <fo:table-column column-number="1" column-width="{$region.side.extent} - {$region.side.margin}"/>
1581           <fo:table-column column-number="2" column-width="proportional-column-width(1)"/>
1582           <fo:table-column column-number="3" column-width="proportional-column-width(1)"/>
1583           <fo:table-column column-number="4" column-width="proportional-column-width(1)"/>
1584         </xsl:when>
1585         <xsl:otherwise>
1586           <fo:table-column column-number="1" column-width="proportional-column-width(1)"/>
1587           <fo:table-column column-number="2" column-width="proportional-column-width(1)"/>
1588           <fo:table-column column-number="3" column-width="proportional-column-width(1)"/>
1589           <fo:table-column column-number="4" column-width="{$region.side.extent} - {$region.side.margin}"/>
1590         </xsl:otherwise>
1591       </xsl:choose>
1592
1593       <fo:table-body>
1594         <fo:table-row height="14pt">
1595
1596           <xsl:choose>
1597             <xsl:when test="$sequence = 'first' or $sequence = 'odd'">
1598               <fo:table-cell text-align="left" background-color="{$sidebar.background.color}" >
1599                 <fo:block>
1600                 </fo:block>
1601               </fo:table-cell>
1602             </xsl:when>
1603             <xsl:otherwise>
1604             </xsl:otherwise>
1605           </xsl:choose>
1606
1607           <fo:table-cell text-align="left" display-align="before" padding="2mm">
1608             <xsl:if test="$fop.extensions = 0">
1609               <xsl:attribute name="relative-align">baseline</xsl:attribute>
1610             </xsl:if>
1611             <fo:block>
1612               <xsl:call-template name="footer.content">
1613                 <xsl:with-param name="pageclass" select="$pageclass"/>
1614                 <xsl:with-param name="sequence" select="$sequence"/>
1615                 <xsl:with-param name="position" select="'left'"/>
1616                 <xsl:with-param name="gentext-key" select="$gentext-key"/>
1617               </xsl:call-template>
1618             </fo:block>
1619           </fo:table-cell>
1620
1621           <fo:table-cell text-align="center" display-align="before" padding="2mm">
1622             <xsl:if test="$fop.extensions = 0">
1623               <xsl:attribute name="relative-align">baseline</xsl:attribute>
1624             </xsl:if>
1625             <fo:block>
1626               <xsl:call-template name="footer.content">
1627                 <xsl:with-param name="pageclass" select="$pageclass"/>
1628                 <xsl:with-param name="sequence" select="$sequence"/>
1629                 <xsl:with-param name="position" select="'center'"/>
1630                 <xsl:with-param name="gentext-key" select="$gentext-key"/>
1631               </xsl:call-template>
1632             </fo:block>
1633           </fo:table-cell>
1634
1635           <fo:table-cell text-align="right" display-align="before" padding="2mm">
1636             <xsl:if test="$fop.extensions = 0">
1637               <xsl:attribute name="relative-align">baseline</xsl:attribute>
1638             </xsl:if>
1639             <fo:block>
1640               <xsl:call-template name="footer.content">
1641                 <xsl:with-param name="pageclass" select="$pageclass"/>
1642                 <xsl:with-param name="sequence" select="$sequence"/>
1643                 <xsl:with-param name="position" select="'right'"/>
1644                 <xsl:with-param name="gentext-key" select="$gentext-key"/>
1645               </xsl:call-template>
1646             </fo:block>
1647           </fo:table-cell>
1648
1649           <xsl:choose>
1650             <xsl:when test="$sequence = 'first' or $sequence = 'odd'">
1651             </xsl:when>
1652             <xsl:otherwise>
1653               <fo:table-cell text-align="left" background-color="{$sidebar.background.color}" >
1654                 <fo:block>
1655                 </fo:block>
1656               </fo:table-cell>
1657             </xsl:otherwise>
1658           </xsl:choose>
1659
1660         </fo:table-row>
1661       </fo:table-body>
1662     </fo:table>
1663   </xsl:variable>
1664
1665   <!-- Really output a footer? -->
1666   <xsl:choose>
1667 <!--
1668     <xsl:when test="$pageclass='titlepage' and $gentext-key='book' and $sequence='first'">
1669       - no, book titlepages have no footers at all -
1670     </xsl:when>
1671 -->
1672     <xsl:when test="$sequence = 'blank' and $footers.on.blank.pages = 0">
1673       <!-- no output -->
1674     </xsl:when>
1675
1676     <xsl:otherwise>
1677       <xsl:copy-of select="$candidate"/>
1678     </xsl:otherwise>
1679   </xsl:choose>
1680 </xsl:template>
1681
1682 </xsl:stylesheet>
1683