1 <?xml version='1.0' encoding='ISO-8859-1'?>
2 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3 xmlns:fo="http://www.w3.org/1999/XSL/Format"
4 xmlns:exsl="http://exslt.org/common"
5 extension-element-prefixes="exsl"
6 exclude-result-prefixes="exsl"
9 <xsl:import href="file:///c:/docbook/docbook-xsl/fo/profile-docbook.xsl"/>
10 <xsl:import href="file:///c:/docbook/docbook-xsl/fo/docbook.xsl"/>
11 <xsl:import href="phpeclipse_pagemaster.xsl"/>
13 <xsl:param name="profile.role" select="'with_index;fo;bold'"/>
15 <xsl:param name="paper.type" select="'A4'"/>
16 <xsl:param name="double.sided" select="1"/>
17 <xsl:param name="section.autolabel" select="1"/>
18 <xsl:param name="toc.section.depth" select="2"/>
19 <xsl:param name="section.label.includes.component.label" select="1"/>
20 <xsl:param name="draft.watermark.image" select="''"/>
21 <xsl:param name="draft.mode" select="'no'"/>
22 <xsl:param name="fop.extensions" select="1"/>
24 <xsl:param name="headers.on.blank.pages" select="1"/>
25 <xsl:param name="header.rule" select="1"/>
26 <xsl:param name="line-height" select="'normal'"/>
28 <xsl:param name="saxon.extensions" select="1"/>
30 <xsl:param name="use.extensions" select="1"/>
31 <xsl:param name="callouts.extension" select="1"/>
32 <xsl:param name="textinsert.extension" select="1"/>
33 <xsl:param name="tablecolumns.extension" select="'0'"></xsl:param>
35 <xsl:param name="callout.graphics">1</xsl:param>
36 <xsl:param name="callout.graphics.extension">.png</xsl:param>
37 <xsl:param name="callout.graphics.path" select="'img/callouts/'"></xsl:param>
39 <xsl:param name="admon.graphics" select="1"></xsl:param>
40 <xsl:param name="admon.graphics.path">img/admon/</xsl:param>
42 <xsl:param name="qanda.defaultlabel">none</xsl:param>
44 <xsl:param name="insert.xref.page.number" select="1"/>
46 <xsl:param name="footnote.number.format" select="i"></xsl:param>
47 <xsl:param name="footnote.number.symbols" select="*"></xsl:param>
50 <xsl:param name="body.margin.top" select="'13mm'"/>
51 <xsl:param name="body.margin.bottom" select="'5mm'"/>
53 <xsl:param name="region.before.extent" select="'7.80mm'"/>
54 <xsl:param name="region.after.extent" select="'5mm'"/>
56 <xsl:param name="region.side.extent" select="'30mm'"/>
57 <xsl:param name="region.side.margin" select="'4mm'"/>
59 <xsl:param name="sidebar.background.color" select="'#eaECF0'"/>
61 <!-- use vertical-align instead of baseline-shift (baseline-shift doesn't work with fop!) -->
63 <xsl:template name="format.footnote.mark">
64 <xsl:param name="mark" select="'?'"/>
65 <fo:inline vertical-align="super" font-size="75%">
66 <xsl:copy-of select="$mark"/>
71 <!-- title.margin.left gives the distance between start of chapter and sections title and normal text flow. -->
72 <!-- with -0pc the titles and the text flow begin at the same column. -->
73 <xsl:param name="title.margin.left" select="'-0pc'"/>
75 <!-- ==================================================================== -->
77 <xsl:param name="page.margin.inner">
79 <xsl:when test="$double.sided != 0">5mm</xsl:when>
80 <xsl:otherwise>5mm</xsl:otherwise>
84 <!-- ==================================================================== -->
86 <xsl:param name="page.margin.outer">
88 <xsl:when test="$double.sided != 0">15mm</xsl:when>
89 <xsl:otherwise>20mm</xsl:otherwise>
93 <!-- ==================================================================== -->
95 <xsl:param name="formal.title.placement">
103 <!-- ==================================================================== -->
105 <xsl:template name="book.titlepage">
106 <fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format">
108 <xsl:call-template name="book.titlepage.before.recto"/>
109 <xsl:call-template name="book.titlepage.recto"/>
112 <xsl:call-template name="book.titlepage.before.verso"/>
113 <xsl:call-template name="book.titlepage.verso"/>
116 <xsl:call-template name="book.titlepage.separator"/>
121 <!-- ==================================================================== -->
123 <xsl:template name="header.content">
124 <xsl:param name="pageclass" select="''"/>
125 <xsl:param name="sequence" select="''"/>
126 <xsl:param name="position" select="''"/>
127 <xsl:param name="gentext-key" select="''"/>
129 <xsl:variable name="candidate">
130 <!-- sequence can be odd, even, first, blank -->
131 <!-- position can be left, center, right -->
134 <xsl:when test="$sequence = 'odd' and $position = 'left'">
135 <fo:retrieve-marker retrieve-class-name="section.head.marker"
136 retrieve-position="first-including-carryover"
137 retrieve-boundary="page"/>
140 <xsl:when test="($sequence = 'odd' or $sequence = 'even' or
141 $sequence = 'blank' or $sequence = 'first') and $position = 'center'">
144 <xsl:when test="($sequence = 'odd' and $position = 'right') or
145 ($sequence = 'even' and $position = 'left') or
146 ($sequence = 'blank' and $position = 'left') or
147 ($sequence = 'first' and $position = 'right')">
149 <xsl:when test="name(/book[position() = 1]) = 'book'">
150 <xsl:value-of select="ancestor-or-self::book/bookinfo/edition"/>
153 <xsl:when test="name(/article[position() = 1]) = 'article'">
154 <xsl:value-of select="ancestor-or-self::article/articleinfo/edition"/>
158 <xsl:value-of select="name(/book[position() = 1])"/>
159 <xsl:value-of select="name(/article[position() = 1])"/>
164 <xsl:when test="($sequence = 'odd' and $position = 'left') or
165 ($sequence = 'even' and $position = 'right') or
166 ($sequence = 'blank' and $position = 'right') or
167 ($sequence = 'first' and $position = 'left')">
169 <xsl:when test="name(/book[position() = 1]) = 'book'">
170 <xsl:value-of select="ancestor-or-self::book/bookinfo/title"/>
173 <xsl:when test="name(/article[position() = 1]) = 'article'">
174 <xsl:value-of select="ancestor-or-self::article/articleinfo/title"/>
178 <xsl:value-of select="name(/book[position() = 1])"/>
179 <xsl:value-of select="name(/article[position() = 1])"/>
185 <xsl:when test="$sequence = 'even' and $position = 'right'">
186 <fo:block><xsl:apply-templates select="." mode="object.title.markup"/></fo:block>
190 <xsl:when test="$sequence = 'first' and $position = 'left'">
193 <xsl:when test="$sequence = 'first' and $position = 'right'">
196 <xsl:when test="$sequence = 'first' and $position = 'center'">
197 <xsl:value-of select="ancestor-or-self::book/bookinfo/corpauthor"/>
200 <xsl:when test="$sequence = 'blank' and $headers.on.blank.pages = 1">
202 <xsl:when test="$position = 'left'">
205 <xsl:when test="$position = 'center'">
206 <!-- <xsl:text>This page intentionally left blank</xsl:text> -->
209 <xsl:when test="$position = 'right'">
217 <!-- Does runtime parameter turn off blank page headers? -->
219 <xsl:when test="$sequence='blank' and $headers.on.blank.pages=0">
223 <xsl:when test="$pageclass = 'titlepage'">
224 <!-- titlepages have no headers -->
228 <xsl:copy-of select="$candidate"/>
233 <!-- ==================================================================== -->
235 <xsl:template name="footer.content">
236 <xsl:param name="pageclass" select="''"/>
237 <xsl:param name="sequence" select="''"/>
238 <xsl:param name="position" select="''"/>
239 <xsl:param name="gentext-key" select="''"/>
242 <!-- pageclass can be front, body, back -->
243 <!-- sequence can be odd, even, first, blank -->
244 <!-- position can be left, center, right -->
247 <xsl:when test="$pageclass = 'titlepage'">
248 <!-- nop; no footer on title pages -->
252 <xsl:when test="($sequence='even' and $double.sided != 0 and $position='left') or
253 ($sequence='odd' and $double.sided != 0 and $position='right')">
254 page <fo:page-number/> of <fo:page-number-citation ref-id="TheVeryLastPage"/>
257 <xsl:when test="($sequence='even' and $position='left') or
258 ($sequence='odd' and $position='right') or
259 ($sequence='first' and $position='right') or
260 ($sequence='blank' and $position='left')">
264 <xsl:when test="($sequence='even' and $position='right') or
265 ($sequence='odd' and $position='left') or
266 ($sequence='first' and $position='left') or
267 ($sequence='blank' and $position='right')">
269 <xsl:when test="name(/book[position() = 1]) = 'book'">
270 <xsl:value-of select="ancestor-or-self::book/bookinfo/orgname"/>
273 <xsl:when test="name(/article[position() = 1]) = 'article'">
274 <xsl:value-of select="ancestor-or-self::article/articleinfo/orgname"/>
278 <xsl:value-of select="name(/book[position() = 1])"/>
279 <xsl:value-of select="name(/article[position() = 1])"/>
285 <xsl:when test="$position='center'">
287 <xsl:when test="name(/book[position() = 1]) = 'book'">
288 <xsl:value-of select="ancestor-or-self::book/bookinfo/pubdate"/>
291 <xsl:when test="name(/article[position() = 1]) = 'article'">
292 <xsl:value-of select="ancestor-or-self::article/articleinfo/pubdate"/>
296 <xsl:value-of select="name(/book[position() = 1])"/>
297 <xsl:value-of select="name(/article[position() = 1])"/>
309 <!-- ==================================================================== -->
311 <xsl:template name="inline.frameseq">
312 <xsl:param name="content">
313 <xsl:apply-templates/>
315 <fo:inline font-weight="bold" color="#555555">
317 <xsl:attribute name="direction">
319 <xsl:when test="@dir = 'ltr' or @dir = 'lro'">ltr</xsl:when>
320 <xsl:otherwise>rtl</xsl:otherwise>
324 [<xsl:copy-of select="$content"/>]
328 <!-- ==================================================================== -->
330 <xsl:template name="inline.highlightsseq">
331 <xsl:param name="content">
332 <xsl:apply-templates/>
335 <fo:inline font-weight="bold" font-size="125%">
337 <xsl:attribute name="direction">
339 <xsl:when test="@dir = 'ltr' or @dir = 'lro'">ltr</xsl:when>
340 <xsl:otherwise>rtl</xsl:otherwise>
344 <xsl:copy-of select="$content"/>
349 <!-- ==================================================================== -->
351 <xsl:template match="guibutton">
352 <xsl:call-template name="inline.frameseq"/>
356 <xsl:template match="guilabel">
357 <xsl:call-template name="inline.frameseq"/>
361 <xsl:template match="database">
362 <xsl:call-template name="inline.boldseq"/>
366 <xsl:template match="highlights">
367 <xsl:call-template name="inline.highlightsseq"/>
370 <!-- ==================================================================== -->
372 <xsl:template name="inline.monoseq">
373 <xsl:param name="content">
374 <xsl:apply-templates/>
376 <fo:inline xsl:use-attribute-sets="monospace.properties">
378 <xsl:attribute name="direction">
380 <xsl:when test="@dir = 'ltr' or @dir = 'lro'">ltr</xsl:when>
381 <xsl:otherwise>rtl</xsl:otherwise>
385 <xsl:apply-templates select="exsl:node-set($content)" mode="hyphenate"/>
389 <xsl:template match="text()" mode="hyphenate" priority="2">
390 <xsl:call-template name="string.subst">
391 <xsl:with-param name="string">
392 <xsl:call-template name="string.subst">
393 <xsl:with-param name="string">
394 <xsl:call-template name="string.subst">
395 <xsl:with-param name="string" select="."/>
396 <xsl:with-param name="target" select="'.'"/>
397 <xsl:with-param name="replacement" select="'.​'"/>
400 <xsl:with-param name="target" select="'\'"/>
401 <xsl:with-param name="replacement" select="'\​'"/>
404 <xsl:with-param name="target" select="'/'"/>
405 <xsl:with-param name="replacement" select="'/​'"/>
409 <xsl:template match="node()|@*" mode="hyphenate">
411 <xsl:apply-templates select="node()|@*" mode="hyphenate"/>
415 <!-- ==================================================================== -->