2 xmlns:
xsl=
"http://www.w3.org/1999/XSL/Transform"
3 xmlns:
fo=
"http://www.w3.org/1999/XSL/Format"
4 xmlns:ml =
"http://www.w3.org/1998/Math/MathML"
7 <!-- $Id: body_directives.xsl 7131 2011-09-26 19:27:15Z paultremblay $ -->
9 <xsl:attribute-set name=
"topic-block">
10 <xsl:attribute name=
"space-after">12pt
</xsl:attribute>
11 <xsl:attribute name=
"space-before">12pt
</xsl:attribute>
14 <xsl:attribute-set name=
"topic-title-block">
15 <xsl:attribute name=
"font-weight">bold
</xsl:attribute>
16 <xsl:attribute name=
"space-after">12pt
</xsl:attribute>
19 <xsl:attribute-set name=
"topic-paragraph-block">
20 <xsl:attribute name=
"space-before">12pt
</xsl:attribute>
21 <xsl:attribute name=
"space-after">0pt
</xsl:attribute>
24 <xsl:attribute-set name=
"topic-first-paragraph-block" use-attribute-sets=
"topic-paragraph-block">
27 <xsl:attribute-set name=
"sidebar-block">
28 <xsl:attribute name=
"space-after">12pt
</xsl:attribute>
29 <xsl:attribute name=
"space-before">12pt
</xsl:attribute>
30 <xsl:attribute name=
"background-color">#FFFFF0
</xsl:attribute>
31 <xsl:attribute name=
"padding">6pt
</xsl:attribute>
32 <xsl:attribute name=
"start-indent">10mm
</xsl:attribute>
33 <xsl:attribute name=
"end-indent">40mm
</xsl:attribute>
36 <xsl:attribute-set name=
"sidebar-title-block">
37 <xsl:attribute name=
"font-weight">bold
</xsl:attribute>
38 <xsl:attribute name=
"space-after">12pt
</xsl:attribute>
41 <xsl:attribute-set name=
"sidebar-subtitle-block">
42 <xsl:attribute name=
"font-weight">bold
</xsl:attribute>
43 <xsl:attribute name=
"space-after">12pt
</xsl:attribute>
47 <xsl:attribute-set name=
"sidebar-paragraph-block">
48 <xsl:attribute name=
"space-before">12pt
</xsl:attribute>
51 <xsl:attribute-set name=
"sidebar-first-paragraph-block" use-attribute-sets=
"sidebar-paragraph-block">
52 <xsl:attribute name=
"space-after">0pt
</xsl:attribute>
55 <xsl:attribute-set name=
"rubric-block">
56 <xsl:attribute name=
"text-align">center
</xsl:attribute>
57 <xsl:attribute name=
"font-size">larger
</xsl:attribute>
58 <xsl:attribute name=
"color">red
</xsl:attribute>
62 <xsl:attribute-set name=
"epigraph-outer-block">
63 <xsl:attribute name=
"start-indent">20mm
</xsl:attribute>
64 <xsl:attribute name=
"end-indent">20mm
</xsl:attribute>
65 <xsl:attribute name=
"space-after">12pt
</xsl:attribute>
66 <xsl:attribute name=
"space-before">12pt
</xsl:attribute>
67 <xsl:attribute name=
"text-align">right
</xsl:attribute>
68 <xsl:attribute name=
"font-style">italic
</xsl:attribute>
71 <xsl:attribute-set name=
"epigraph-paragraph-block">
72 <xsl:attribute name=
"start-indent">inherit
</xsl:attribute>
73 <xsl:attribute name=
"end-indent">inherit
</xsl:attribute>
74 <xsl:attribute name=
"space-before">12pt
</xsl:attribute>
77 <xsl:attribute-set name=
"epigraph-first-paragraph-block" use-attribute-sets=
"block-quote-paragraph-block">
78 <xsl:attribute name=
"space-before">0pt
</xsl:attribute>
82 <xsl:attribute-set name=
"epigraph-attribution-block">
83 <xsl:attribute name=
"text-align">right
</xsl:attribute>
87 <xsl:attribute-set name=
"highlights-outer-block">
88 <xsl:attribute name=
"start-indent">20mm
</xsl:attribute>
89 <xsl:attribute name=
"end-indent">20mm
</xsl:attribute>
90 <xsl:attribute name=
"space-after">12pt
</xsl:attribute>
91 <xsl:attribute name=
"space-before">12pt
</xsl:attribute>
94 <xsl:attribute-set name=
"highlights-paragraph-block">
95 <xsl:attribute name=
"start-indent">inherit
</xsl:attribute>
96 <xsl:attribute name=
"end-indent">inherit
</xsl:attribute>
97 <xsl:attribute name=
"space-before">12pt
</xsl:attribute>
100 <xsl:attribute-set name=
"highlights-first-paragraph-block" use-attribute-sets=
"block-quote-paragraph-block">
101 <xsl:attribute name=
"space-before">0pt
</xsl:attribute>
105 <xsl:attribute-set name=
"pull-quote-outer-block">
106 <xsl:attribute name=
"start-indent">20mm
</xsl:attribute>
107 <xsl:attribute name=
"end-indent">20mm
</xsl:attribute>
108 <xsl:attribute name=
"space-after">12pt
</xsl:attribute>
109 <xsl:attribute name=
"space-before">12pt
</xsl:attribute>
112 <xsl:attribute-set name=
"pull-quote-paragraph-block">
113 <xsl:attribute name=
"start-indent">inherit
</xsl:attribute>
114 <xsl:attribute name=
"end-indent">inherit
</xsl:attribute>
115 <xsl:attribute name=
"space-before">12pt
</xsl:attribute>
118 <xsl:attribute-set name=
"pull-quote-first-paragraph-block" use-attribute-sets=
"block-quote-paragraph-block">
119 <xsl:attribute name=
"space-before">0pt
</xsl:attribute>
122 <xsl:attribute-set name=
"pull-quote-attribution-block">
123 <xsl:attribute name=
"text-align">right
</xsl:attribute>
127 <xsl:attribute-set name=
"container-outer-block">
128 <xsl:attribute name=
"space-after">12pt
</xsl:attribute>
129 <xsl:attribute name=
"space-before">12pt
</xsl:attribute>
132 <xsl:attribute-set name=
"container-paragraph-block">
133 <xsl:attribute name=
"space-before">12pt
</xsl:attribute>
136 <xsl:attribute-set name=
"container-first-paragraph-block" use-attribute-sets=
"block-quote-paragraph-block">
137 <xsl:attribute name=
"space-before">0pt
</xsl:attribute>
140 <xsl:attribute-set name=
"mathml-block">
141 <xsl:attribute name=
"space-before">12pt
</xsl:attribute>
142 <xsl:attribute name=
"space-after">12pt
</xsl:attribute>
146 <!--END OF ATTRIBUTE SETS-->
149 <xsl:template match=
"topic[not(@classes)]">
150 <fo:block xsl:
use-attribute-sets=
"topic-block" role=
"topic">
151 <xsl:apply-templates/>
155 <xsl:template match=
"topic[not(@classes)]/title">
156 <fo:block role=
"title" xsl:use-attribute-sets =
"topic-title-block">
157 <xsl:apply-templates/>
161 <xsl:template match=
"topic[not(@classes)]/paragraph[1]" priority=
"2">
162 <fo:block role=
"topic-paragraph" xsl:
use-attribute-sets=
"topic-first-paragraph-block">
163 <xsl:apply-templates/>
167 <xsl:template match=
"topic[not(@classes)]/paragraph">
168 <fo:block role=
"topic-paragraph" xsl:
use-attribute-sets=
"topic-paragraph-block">
169 <xsl:apply-templates/>
174 <!--SHOULD I generate a warning that FOP can't do sidebars instead?-->
175 <xsl:template match=
"sidebar">
176 <fo:block xsl:
use-attribute-sets=
"sidebar-block" role=
"sidebar">
177 <xsl:apply-templates/>
181 <xsl:template match=
"sidebar/title">
182 <fo:block role=
"title" xsl:use-attribute-sets =
"sidebar-title-block">
183 <xsl:apply-templates/>
187 <xsl:template match=
"sidebar/subtitle">
188 <fo:block role=
"subtitle" xsl:use-attribute-sets =
"sidebar-subtitle-block">
189 <xsl:apply-templates/>
193 <xsl:template match=
"sidebar/paragraph[1]" priority=
"2">
194 <fo:block role=
"sidebar-paragraph" xsl:
use-attribute-sets=
"sidebar-first-paragraph-block">
195 <xsl:apply-templates/>
199 <xsl:template match=
"sidebar/paragraph">
200 <fo:block role=
"sidebar-paragraph" xsl:
use-attribute-sets=
"sidebar-paragraph-block">
201 <xsl:apply-templates/>
206 <xsl:template match=
"rubric[not(@classes)]">
207 <fo:block role=
"rubric" xsl:
use-attribute-sets=
"rubric-block">
208 <xsl:apply-templates/>
213 <xsl:template match=
"block_quote[@classes='epigraph']">
214 <fo:block role=
"epigraph" xsl:use-attribute-sets =
"epigraph-outer-block">
215 <xsl:apply-templates/>
219 <xsl:template match=
"block_quote[@classes='epigraph']/paragraph">
220 <fo:block role=
"epigraph-paragraph" xsl:use-attribute-sets =
"epigraph-paragraph-block">
221 <xsl:apply-templates/>
225 <xsl:template match=
"block_quote[@classes='epigraph']/paragraph[1]" priority=
"2">
226 <fo:block role=
"epigraph-paragraph" xsl:use-attribute-sets =
"epigraph-first-paragraph-block">
227 <xsl:apply-templates/>
231 <xsl:template match=
"block_quote[@classes='epigraph']/attribution">
232 <fo:block role=
"epigraph-attribution" xsl:use-attribute-sets =
"epigraph-attribution-block">
233 <xsl:value-of select=
"$text-before-epigraph-attribution"/>
234 <xsl:apply-templates/>
239 <xsl:template match=
"block_quote[@classes='highlights']">
240 <fo:block role=
"highlights" xsl:use-attribute-sets =
"highlights-outer-block">
241 <xsl:apply-templates/>
245 <xsl:template match=
"block_quote[@classes='highlights']/paragraph">
246 <fo:block role=
"highlights-paragraph" xsl:use-attribute-sets =
"highlights-paragraph-block">
247 <xsl:apply-templates/>
251 <xsl:template match=
"block_quote[@classes='highlights']/paragraph[1]" priority=
"2">
252 <fo:block role=
"highlights-paragraph" xsl:use-attribute-sets =
"highlights-first-paragraph-block">
253 <xsl:apply-templates/>
258 <xsl:template match=
"block_quote[@classes='pull-quote']">
259 <fo:block role=
"pull-quote" xsl:use-attribute-sets =
"pull-quote-outer-block">
260 <xsl:apply-templates/>
264 <xsl:template match=
"block_quote[@classes='pull-quote']/paragraph">
265 <fo:block role=
"pull-quote-paragraph" xsl:use-attribute-sets =
"pull-quote-paragraph-block">
266 <xsl:apply-templates/>
270 <xsl:template match=
"block_quote[@classes='pull-quote']/paragraph[1]" priority=
"2">
271 <fo:block role=
"pull-quote-paragraph" xsl:use-attribute-sets =
"pull-quote-first-paragraph-block">
272 <xsl:apply-templates/>
276 <xsl:template match=
"block_quote[@classes='pull-quote']/attribution">
277 <fo:block role=
"pull-quote-attribution" xsl:use-attribute-sets =
"pull-quote-attribution-block">
278 <xsl:value-of select=
"$text-before-pull-quote-attribution"/>
279 <xsl:apply-templates/>
284 <xsl:template match=
"container">
285 <fo:block role=
"container" xsl:use-attribute-sets =
"container-outer-block">
286 <xsl:apply-templates/>
290 <xsl:template match=
"container/paragraph">
291 <fo:block role=
"container-paragraph" xsl:use-attribute-sets =
"container-paragraph-block">
292 <xsl:apply-templates/>
296 <xsl:template match=
"container/paragraph[1]" priority=
"2">
297 <fo:block role=
"container-paragraph" xsl:use-attribute-sets =
"container-first-paragraph-block">
298 <xsl:apply-templates/>
302 <xsl:template match=
"compound">
303 <xsl:apply-templates/>
306 <xsl:template match=
"math_block">
308 <xsl:when test=
"descendant::ml:math">
309 <fo:block xsl:
use-attribute-sets=
"mathml-block">
310 <fo:instream-foreign-object>
311 <xsl:copy-of select=
"ml:math"/>
312 </fo:instream-foreign-object>
316 <fo:block xsl:
use-attribute-sets=
"literal-block">
317 <xsl:apply-templates/>