blob: 44588098761ef2a91796bfd15bd77ef24249149f [file] [log] [blame]
Filippo Diotalevib4c8e3e2009-10-13 12:55:35 +00001<?xml version="1.0"?>
2<!--
3 Licensed to the Apache Software Foundation (ASF) under one or more
4 contributor license agreements. See the NOTICE file distributed with
5 this work for additional information regarding copyright ownership.
6 The ASF licenses this file to You under the Apache License, Version 2.0
7 (the "License"); you may not use this file except in compliance with
8 the License. You may obtain a copy of the License at
9
10 http://www.apache.org/licenses/LICENSE-2.0
11
12 Unless required by applicable law or agreed to in writing, software
13 distributed under the License is distributed on an "AS IS" BASIS,
14 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 See the License for the specific language governing permissions and
16 limitations under the License.
17-->
18<!--
19 This XSL is based heavily on the Spring Frameworks' XSL script
20-->
21<!DOCTYPE xsl:stylesheet [
22 <!ENTITY admon_gfx_path "src/docbkx/images/admons/">
23 <!ENTITY copyright "&#xA9;">
24 ]>
25<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
26 xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0">
27 <xsl:import href="urn:docbkx:stylesheet"/>
28 <xsl:template match="imagedata">
29 <xsl:variable name="imagefile">
30 <xsl:value-of select="substring-after(@fileref,'images/')"/>
31 </xsl:variable>
32 <fo:block>
33 <!-- TODO: make this more dynamic-->
34 <fo:external-graphic
35 src="{concat('file:target/site/book/images/',$imagefile)}"/>
36 </fo:block>
37 </xsl:template>
38 <!--###################################################
39 Custom Title Page
40 ################################################### -->
41 <xsl:template name="book.titlepage.recto">
42 <fo:block>
43 <fo:table table-layout="fixed" width="175mm">
44 <fo:table-column column-width="175mm"/>
45 <fo:table-body>
46 <fo:table-row>
47 <fo:table-cell text-align="center">
48 <fo:block>
49 <fo:external-graphic
50 src="file:src/docbkx/images/logo.jpeg"/>
51 </fo:block>
52 <fo:block font-family="Helvetica" font-size="22pt"
53 padding-before="10mm">
54 <xsl:value-of select="bookinfo/subtitle"/>
55 </fo:block>
56 <fo:block font-family="Helvetica" font-size="12pt"
57 padding="10mm"> Version <xsl:value-of
58 select="bookinfo/releaseinfo"/> </fo:block>
59 </fo:table-cell>
60 </fo:table-row>
61 <fo:table-row>
62 <fo:table-cell text-align="center">
63 <fo:block font-family="Helvetica" font-size="14pt"
64 padding="10mm">
65 <xsl:value-of select="bookinfo/pubdate"/>
66 </fo:block>
67 </fo:table-cell>
68 </fo:table-row>
69 <fo:table-row>
70 <fo:table-cell text-align="center">
71 <fo:block font-family="Helvetica" font-size="12pt"
72 padding="10mm">
73 <xsl:text>Copyright &copyright; 2004-2007,
74 Apache Software Foundation</xsl:text>
75 </fo:block>
76 <!--<fo:block>-->
77 <!--<fo:external-graphic src="file:src/docbkx/images/asf-logo.gif"/>-->
78 <!--</fo:block>-->
79 <fo:block font-family="Helvetica" font-size="10pt"
80 padding="1mm">
81 <xsl:apply-templates
82 select="bookinfo/legalnotice/*"/>
83 <!--<xsl:value-of select="bookinfo/legalnotice"/>-->
84 </fo:block>
85 </fo:table-cell>
86 </fo:table-row>
87 </fo:table-body>
88 </fo:table>
89 </fo:block>
90 </xsl:template>
91 <!-- Prevent blank pages in output -->
92 <xsl:template name="book.titlepage.before.verso">
93 </xsl:template>
94 <xsl:template name="book.titlepage.verso">
95 </xsl:template>
96 <xsl:template name="book.titlepage.separator">
97 </xsl:template>
98 <!--###################################################
99 Header
100 ################################################### -->
101 <!-- More space in the center header for long text -->
102 <xsl:attribute-set name="header.content.properties">
103 <xsl:attribute name="font-family">
104 <xsl:value-of select="$body.font.family"/>
105 </xsl:attribute>
106 <xsl:attribute name="margin-left">-5em</xsl:attribute>
107 <xsl:attribute name="margin-right">-5em</xsl:attribute>
108 </xsl:attribute-set>
109 <!--###################################################
110 Custom Footer
111 ################################################### -->
112 <xsl:template name="footer.content">
113 <xsl:param name="pageclass" select="''"/>
114 <xsl:param name="sequence" select="''"/>
115 <xsl:param name="position" select="''"/>
116 <xsl:param name="gentext-key" select="''"/>
117 <xsl:variable name="Version">
118 <xsl:if test="//releaseinfo">
119 <xsl:text>Apache ActiveMQ (</xsl:text>
120 <xsl:value-of select="//releaseinfo"/>
121 <xsl:text>)</xsl:text>
122 </xsl:if>
123 </xsl:variable>
124 <xsl:choose>
125 <xsl:when test="$sequence='blank'">
126 <xsl:if test="$position = 'center'">
127 <xsl:value-of select="$Version"/>
128 </xsl:if>
129 </xsl:when>
130 <!-- for double sided printing, print page numbers on alternating sides (of the page) -->
131 <xsl:when test="$double.sided != 0">
132 <xsl:choose>
133 <xsl:when test="$sequence = 'even' and $position='left'">
134 <fo:page-number/>
135 </xsl:when>
136 <xsl:when test="$sequence = 'odd' and $position='right'">
137 <fo:page-number/>
138 </xsl:when>
139 <xsl:when test="$position='center'">
140 <xsl:value-of select="$Version"/>
141 </xsl:when>
142 </xsl:choose>
143 </xsl:when>
144 <!-- for single sided printing, print all page numbers on the right (of the page) -->
145 <xsl:when test="$double.sided = 0">
146 <xsl:choose>
147 <xsl:when test="$position='center'">
148 <xsl:value-of select="$Version"/>
149 </xsl:when>
150 <xsl:when test="$position='right'">
151 <fo:page-number/>
152 </xsl:when>
153 </xsl:choose>
154 </xsl:when>
155 </xsl:choose>
156 </xsl:template>
157 <!--###################################################
158 Extensions
159 ################################################### -->
160 <!-- These extensions are required for table printing and other stuff -->
161 <xsl:param name="use.extensions">1</xsl:param>
162 <xsl:param name="tablecolumns.extension">0</xsl:param>
163 <xsl:param name="callout.extensions">1</xsl:param>
164 <!-- FOP provide only PDF Bookmarks at the moment -->
165 <xsl:param name="fop.extensions">1</xsl:param>
166 <!--###################################################
167 Table Of Contents
168 ################################################### -->
169 <!-- Generate the TOCs for named components only -->
170 <xsl:param name="generate.toc"> book toc </xsl:param>
171 <!-- Show only Sections up to level 3 in the TOCs -->
172 <!--<xsl:param name="toc.section.depth">2</xsl:param>-->
173 <!-- Dot and Whitespace as separator in TOC between Label and Title-->
174 <!--<xsl:param name="autotoc.label.separator" select="'. '"/>-->
175 <!--###################################################
176 Paper & Page Size
177 ################################################### -->
178 <!-- Paper type, no headers on blank pages, no double sided printing -->
179 <xsl:param name="paper.type" select="'A4'"/>
180 <xsl:param name="double.sided">0</xsl:param>
181 <xsl:param name="headers.on.blank.pages">0</xsl:param>
182 <xsl:param name="footers.on.blank.pages">0</xsl:param>
183 <!-- Space between paper border and content (chaotic stuff, don't touch) -->
184 <xsl:param name="page.margin.top">5mm</xsl:param>
185 <xsl:param name="region.before.extent">10mm</xsl:param>
186 <xsl:param name="body.margin.top">10mm</xsl:param>
187 <xsl:param name="body.margin.bottom">15mm</xsl:param>
188 <xsl:param name="region.after.extent">10mm</xsl:param>
189 <xsl:param name="page.margin.bottom">0mm</xsl:param>
190 <xsl:param name="page.margin.outer">18mm</xsl:param>
191 <xsl:param name="page.margin.inner">18mm</xsl:param>
192 <!-- No intendation of Titles -->
193 <xsl:param name="title.margin.left">0pc</xsl:param>
194 <!--###################################################
195 Fonts & Styles
196 ################################################### -->
197 <!-- Left aligned text and no hyphenation -->
198 <xsl:param name="alignment">justify</xsl:param>
199 <xsl:param name="hyphenate">false</xsl:param>
200 <!-- Default Font size -->
201 <xsl:param name="body.font.master">11</xsl:param>
202 <xsl:param name="body.font.small">8</xsl:param>
203 <!-- Line height in body text -->
204 <xsl:param name="line-height">1.4</xsl:param>
205 <!-- Monospaced fonts are smaller than regular text -->
206 <xsl:attribute-set name="monospace.properties">
207 <xsl:attribute name="font-family">
208 <xsl:value-of select="$monospace.font.family"/>
209 </xsl:attribute>
210 <xsl:attribute name="font-size">0.8em</xsl:attribute>
211 </xsl:attribute-set>
212 <!--###################################################
213 Tables
214 ################################################### -->
215 <!-- The table width should be adapted to the paper size -->
216 <xsl:param name="default.table.width">17.4cm</xsl:param>
217 <!-- Some padding inside tables -->
218 <xsl:attribute-set name="table.cell.padding">
219 <xsl:attribute name="padding-left">4pt</xsl:attribute>
220 <xsl:attribute name="padding-right">4pt</xsl:attribute>
221 <xsl:attribute name="padding-top">4pt</xsl:attribute>
222 <xsl:attribute name="padding-bottom">4pt</xsl:attribute>
223 </xsl:attribute-set>
224 <!-- Only hairlines as frame and cell borders in tables -->
225 <xsl:param name="table.frame.border.thickness">0.1pt</xsl:param>
226 <xsl:param name="table.cell.border.thickness">0.1pt</xsl:param>
227 <!--###################################################
228 Labels
229 ################################################### -->
230 <!-- Label Chapters and Sections (numbering) -->
231 <xsl:param name="chapter.autolabel">1</xsl:param>
232 <xsl:param name="section.autolabel" select="1"/>
233 <xsl:param name="section.label.includes.component.label" select="1"/>
234 <!--###################################################
235 Titles
236 ################################################### -->
237 <!-- Chapter title size -->
238 <xsl:attribute-set name="chapter.titlepage.recto.style">
239 <xsl:attribute name="text-align">left</xsl:attribute>
240 <xsl:attribute name="font-weight">bold</xsl:attribute>
241 <xsl:attribute name="font-size">
242 <xsl:value-of select="$body.font.master * 1.8"/>
243 <xsl:text>pt</xsl:text>
244 </xsl:attribute>
245 </xsl:attribute-set>
246 <!-- Why is the font-size for chapters hardcoded in the XSL FO templates?
247 Let's remove it, so this sucker can use our attribute-set only... -->
248 <xsl:template match="title" mode="chapter.titlepage.recto.auto.mode">
249 <fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format"
250 xsl:use-attribute-sets="chapter.titlepage.recto.style">
251 <xsl:call-template name="component.title">
252 <xsl:with-param name="node"
253 select="ancestor-or-self::chapter[1]"/>
254 </xsl:call-template>
255 </fo:block>
256 </xsl:template>
257 <!-- Sections 1, 2 and 3 titles have a small bump factor and padding -->
258 <xsl:attribute-set name="section.title.level1.properties">
259 <xsl:attribute name="space-before.optimum">0.8em</xsl:attribute>
260 <xsl:attribute name="space-before.minimum">0.8em</xsl:attribute>
261 <xsl:attribute name="space-before.maximum">0.8em</xsl:attribute>
262 <xsl:attribute name="font-size">
263 <xsl:value-of select="$body.font.master * 1.5"/>
264 <xsl:text>pt</xsl:text>
265 </xsl:attribute>
266 <xsl:attribute name="space-after.optimum">0.1em</xsl:attribute>
267 <xsl:attribute name="space-after.minimum">0.1em</xsl:attribute>
268 <xsl:attribute name="space-after.maximum">0.1em</xsl:attribute>
269 </xsl:attribute-set>
270 <xsl:attribute-set name="section.title.level2.properties">
271 <xsl:attribute name="space-before.optimum">0.6em</xsl:attribute>
272 <xsl:attribute name="space-before.minimum">0.6em</xsl:attribute>
273 <xsl:attribute name="space-before.maximum">0.6em</xsl:attribute>
274 <xsl:attribute name="font-size">
275 <xsl:value-of select="$body.font.master * 1.25"/>
276 <xsl:text>pt</xsl:text>
277 </xsl:attribute>
278 <xsl:attribute name="space-after.optimum">0.1em</xsl:attribute>
279 <xsl:attribute name="space-after.minimum">0.1em</xsl:attribute>
280 <xsl:attribute name="space-after.maximum">0.1em</xsl:attribute>
281 </xsl:attribute-set>
282 <xsl:attribute-set name="section.title.level3.properties">
283 <xsl:attribute name="space-before.optimum">0.4em</xsl:attribute>
284 <xsl:attribute name="space-before.minimum">0.4em</xsl:attribute>
285 <xsl:attribute name="space-before.maximum">0.4em</xsl:attribute>
286 <xsl:attribute name="font-size">
287 <xsl:value-of select="$body.font.master * 1.0"/>
288 <xsl:text>pt</xsl:text>
289 </xsl:attribute>
290 <xsl:attribute name="space-after.optimum">0.1em</xsl:attribute>
291 <xsl:attribute name="space-after.minimum">0.1em</xsl:attribute>
292 <xsl:attribute name="space-after.maximum">0.1em</xsl:attribute>
293 </xsl:attribute-set>
294 <!-- Titles of formal objects (tables, examples, ...) -->
295 <xsl:attribute-set name="formal.title.properties"
296 use-attribute-sets="normal.para.spacing">
297 <xsl:attribute name="font-weight">bold</xsl:attribute>
298 <xsl:attribute name="font-size">
299 <xsl:value-of select="$body.font.master"/>
300 <xsl:text>pt</xsl:text>
301 </xsl:attribute>
302 <xsl:attribute name="hyphenate">false</xsl:attribute>
303 <xsl:attribute name="space-after.minimum">0.4em</xsl:attribute>
304 <xsl:attribute name="space-after.optimum">0.6em</xsl:attribute>
305 <xsl:attribute name="space-after.maximum">0.8em</xsl:attribute>
306 </xsl:attribute-set>
307 <!--###################################################
308 Programlistings
309 ################################################### -->
310 <!-- Verbatim text formatting (programlistings) -->
311 <xsl:attribute-set name="monospace.verbatim.properties">
312 <xsl:attribute name="font-size">
313 <xsl:value-of select="$body.font.small * 1.0"/>
314 <xsl:text>pt</xsl:text>
315 </xsl:attribute>
316 <xsl:attribute name="wrap-option">wrap</xsl:attribute>
317 </xsl:attribute-set>
318 <xsl:attribute-set name="verbatim.properties">
319 <xsl:attribute name="space-before.minimum">1em</xsl:attribute>
320 <xsl:attribute name="space-before.optimum">1em</xsl:attribute>
321 <xsl:attribute name="space-before.maximum">1em</xsl:attribute>
322 <xsl:attribute name="border-color">#444444</xsl:attribute>
323 <xsl:attribute name="border-style">solid</xsl:attribute>
324 <xsl:attribute name="border-width">0.1pt</xsl:attribute>
325 <xsl:attribute name="padding-top">0.5em</xsl:attribute>
326 <xsl:attribute name="padding-left">0.5em</xsl:attribute>
327 <xsl:attribute name="padding-right">0.5em</xsl:attribute>
328 <xsl:attribute name="padding-bottom">0.5em</xsl:attribute>
329 <xsl:attribute name="margin-left">0.5em</xsl:attribute>
330 <xsl:attribute name="margin-right">0.5em</xsl:attribute>
331 </xsl:attribute-set>
332 <!-- Shade (background) programlistings -->
333 <xsl:param name="shade.verbatim">1</xsl:param>
334 <xsl:attribute-set name="shade.verbatim.style">
335 <xsl:attribute name="background-color">#F0F0F0</xsl:attribute>
336 </xsl:attribute-set>
337 <!--###################################################
338 Callouts
339 ################################################### -->
340 <!-- Use images for callouts instead of (1) (2) (3) -->
341 <xsl:param name="callout.graphics">0</xsl:param>
342 <xsl:param name="callout.unicode">1</xsl:param>
343 <!-- Place callout marks at this column in annotated areas -->
344 <xsl:param name="callout.defaultcolumn">90</xsl:param>
345 <!--###################################################
346 Admonitions
347 ################################################### -->
348 <!-- Use nice graphics for admonitions -->
349 <xsl:param name="admon.graphics">'1'</xsl:param>
350 <xsl:param name="admon.graphics.path">&admon_gfx_path;</xsl:param>
351 <!--###################################################
352 Misc
353 ################################################### -->
354 <!-- Placement of titles -->
355 <xsl:param name="formal.title.placement"> figure after example before
356 equation before table before procedure before </xsl:param>
357 <!-- Format Variable Lists as Blocks (prevents horizontal overflow) -->
358 <xsl:param name="variablelist.as.blocks">1</xsl:param>
359 <!-- The horrible list spacing problems -->
360 <xsl:attribute-set name="list.block.spacing">
361 <xsl:attribute name="space-before.optimum">0.8em</xsl:attribute>
362 <xsl:attribute name="space-before.minimum">0.8em</xsl:attribute>
363 <xsl:attribute name="space-before.maximum">0.8em</xsl:attribute>
364 <xsl:attribute name="space-after.optimum">0.1em</xsl:attribute>
365 <xsl:attribute name="space-after.minimum">0.1em</xsl:attribute>
366 <xsl:attribute name="space-after.maximum">0.1em</xsl:attribute>
367 </xsl:attribute-set>
368 <!--###################################################
369 colored and hyphenated links
370 ################################################### -->
371 <xsl:template match="ulink">
372 <fo:basic-link external-destination="{@url}"
373 xsl:use-attribute-sets="xref.properties"
374 text-decoration="underline" color="blue">
375 <xsl:choose>
376 <xsl:when test="count(child::node())=0">
377 <xsl:value-of select="@url"/>
378 </xsl:when>
379 <xsl:otherwise>
380 <xsl:apply-templates/>
381 </xsl:otherwise>
382 </xsl:choose>
383 </fo:basic-link>
384 </xsl:template>
385</xsl:stylesheet>