2 <xsl:stylesheet xmlns:
xsl=
"http://www.w3.org/1999/XSL/Transform"
5 <!-- ********************************************************************
6 $Id: block.xsl,v 1.1 2007/03/10 05:15:13 scott Exp $
7 ********************************************************************
9 This file is part of the XSL DocBook Stylesheet distribution.
10 See ../README or http://nwalsh.com/docbook/xsl/ for copyright
11 and other information.
13 ******************************************************************** -->
15 <!-- ==================================================================== -->
16 <!-- What should we do about styling blockinfo? -->
18 <xsl:template match=
"blockinfo|info">
22 <!-- ==================================================================== -->
24 <xsl:template name=
"block.object">
26 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
27 <xsl:call-template name=
"anchor"/>
28 <xsl:apply-templates/>
32 <!-- ==================================================================== -->
34 <xsl:template match=
"para">
35 <xsl:call-template name=
"paragraph">
36 <xsl:with-param name=
"class">
37 <xsl:if test=
"@role and $para.propagates.style != 0">
38 <xsl:value-of select=
"@role"/>
41 <xsl:with-param name=
"content">
42 <xsl:if test=
"position() = 1 and parent::listitem">
43 <xsl:call-template name=
"anchor">
44 <xsl:with-param name=
"node" select=
"parent::listitem"/>
48 <xsl:call-template name=
"anchor"/>
49 <xsl:apply-templates/>
54 <xsl:template name=
"paragraph">
55 <xsl:param name=
"class" select=
"''"/>
56 <xsl:param name=
"content"/>
58 <xsl:variable name=
"p">
60 <xsl:call-template name=
"dir"/>
61 <xsl:if test=
"$class != ''">
62 <xsl:apply-templates select=
"." mode=
"class.attribute">
63 <xsl:with-param name=
"class" select=
"$class"/>
64 </xsl:apply-templates>
66 <xsl:copy-of select=
"$content"/>
71 <xsl:when test=
"$html.cleanup != 0">
72 <xsl:call-template name=
"unwrap.p">
73 <xsl:with-param name=
"p" select=
"$p"/>
77 <xsl:copy-of select=
"$p"/>
82 <xsl:template match=
"simpara">
83 <!-- see also listitem/simpara in lists.xsl -->
85 <xsl:if test=
"@role and $para.propagates.style != 0">
86 <xsl:apply-templates select=
"." mode=
"class.attribute">
87 <xsl:with-param name=
"class" select=
"@role"/>
88 </xsl:apply-templates>
91 <xsl:call-template name=
"anchor"/>
92 <xsl:apply-templates/>
96 <xsl:template match=
"formalpara">
97 <xsl:call-template name=
"paragraph">
98 <xsl:with-param name=
"class">
99 <xsl:if test=
"@role and $para.propagates.style != 0">
100 <xsl:value-of select=
"@role"/>
103 <xsl:with-param name=
"content">
104 <xsl:call-template name=
"anchor"/>
105 <xsl:apply-templates/>
110 <!-- Only use title from info -->
111 <xsl:template match=
"formalpara/info">
112 <xsl:apply-templates select=
"title"/>
115 <xsl:template match=
"formalpara/title|formalpara/info/title">
116 <xsl:variable name=
"titleStr">
117 <xsl:apply-templates/>
119 <xsl:variable name=
"lastChar">
120 <xsl:if test=
"$titleStr != ''">
121 <xsl:value-of select=
"substring($titleStr,string-length($titleStr),1)"/>
126 <xsl:copy-of select=
"$titleStr"/>
127 <xsl:if test=
"$lastChar != ''
128 and not(contains($runinhead.title.end.punct, $lastChar))">
129 <xsl:value-of select=
"$runinhead.default.title.end.punct"/>
131 <xsl:text> </xsl:text>
135 <xsl:template match=
"formalpara/para">
136 <xsl:apply-templates/>
139 <!-- ==================================================================== -->
141 <xsl:template match=
"blockquote">
143 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
144 <xsl:if test=
"@lang or @xml:lang">
145 <xsl:call-template name=
"language.attribute"/>
147 <xsl:call-template name=
"anchor"/>
150 <xsl:when test=
"attribution">
151 <table border=
"0" width=
"100%"
152 cellspacing=
"0" cellpadding=
"0" class=
"blockquote"
153 summary=
"Block quote">
155 <td width=
"10%" valign=
"top"> </td>
156 <td width=
"80%" valign=
"top">
157 <xsl:apply-templates select=
"child::*[local-name(.)!='attribution']"/>
159 <td width=
"10%" valign=
"top"> </td>
162 <td width=
"10%" valign=
"top"> </td>
163 <td colspan=
"2" align=
"right" valign=
"top">
164 <xsl:text>--
</xsl:text>
165 <xsl:apply-templates select=
"attribution"/>
172 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
173 <xsl:apply-templates/>
180 <xsl:template match=
"blockquote/title|blockquote/info/title">
181 <div class=
"blockquote-title">
184 <xsl:apply-templates/>
190 <xsl:template match=
"epigraph">
192 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
193 <xsl:apply-templates select=
"para|simpara|formalpara|literallayout"/>
194 <xsl:if test=
"attribution">
195 <div class=
"attribution">
196 <span>--
<xsl:apply-templates select=
"attribution"/></span>
202 <xsl:template match=
"attribution">
204 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
205 <xsl:apply-templates/>
209 <!-- ==================================================================== -->
211 <xsl:template match=
"abstract|sidebar">
213 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
214 <xsl:call-template name=
"anchor"/>
215 <xsl:call-template name=
"formal.object.heading">
216 <xsl:with-param name=
"title">
217 <xsl:apply-templates select=
"." mode=
"title.markup">
218 <xsl:with-param name=
"allow-anchors" select=
"'1'"/>
219 </xsl:apply-templates>
222 <xsl:apply-templates/>
226 <xsl:template match=
"abstract/title|sidebar/title">
229 <xsl:template match=
"sidebar/sidebarinfo|sidebar/info"/>
231 <!-- ==================================================================== -->
233 <xsl:template match=
"msgset">
234 <xsl:apply-templates/>
237 <xsl:template match=
"msgentry">
238 <xsl:call-template name=
"block.object"/>
241 <xsl:template match=
"simplemsgentry">
242 <xsl:call-template name=
"block.object"/>
245 <xsl:template match=
"msg">
246 <xsl:call-template name=
"block.object"/>
249 <xsl:template match=
"msgmain">
250 <xsl:apply-templates/>
253 <xsl:template match=
"msgmain/title">
254 <b><xsl:apply-templates/></b>
257 <xsl:template match=
"msgsub">
258 <xsl:apply-templates/>
261 <xsl:template match=
"msgsub/title">
262 <b><xsl:apply-templates/></b>
265 <xsl:template match=
"msgrel">
266 <xsl:apply-templates/>
269 <xsl:template match=
"msgrel/title">
270 <b><xsl:apply-templates/></b>
273 <xsl:template match=
"msgtext">
274 <xsl:apply-templates/>
277 <xsl:template match=
"msginfo">
278 <xsl:call-template name=
"block.object"/>
281 <xsl:template match=
"msglevel">
284 <xsl:call-template name=
"gentext.template">
285 <xsl:with-param name=
"context" select=
"'msgset'"/>
286 <xsl:with-param name=
"name" select=
"'MsgLevel'"/>
289 <xsl:apply-templates/>
293 <xsl:template match=
"msgorig">
296 <xsl:call-template name=
"gentext.template">
297 <xsl:with-param name=
"context" select=
"'msgset'"/>
298 <xsl:with-param name=
"name" select=
"'MsgOrig'"/>
301 <xsl:apply-templates/>
305 <xsl:template match=
"msgaud">
308 <xsl:call-template name=
"gentext.template">
309 <xsl:with-param name=
"context" select=
"'msgset'"/>
310 <xsl:with-param name=
"name" select=
"'MsgAud'"/>
313 <xsl:apply-templates/>
317 <xsl:template match=
"msgexplan">
318 <xsl:call-template name=
"block.object"/>
321 <xsl:template match=
"msgexplan/title">
322 <p><b><xsl:apply-templates/></b></p>
325 <!-- ==================================================================== -->
327 <xsl:template match=
"revhistory">
329 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
330 <table border=
"0" width=
"100%" summary=
"Revision history">
332 <th align=
"left" valign=
"top" colspan=
"3">
334 <xsl:call-template name=
"gentext">
335 <xsl:with-param name=
"key" select=
"'RevHistory'"/>
340 <xsl:apply-templates/>
345 <xsl:template match=
"revhistory/revision">
346 <xsl:variable name=
"revnumber" select=
"revnumber"/>
347 <xsl:variable name=
"revdate" select=
"date"/>
348 <xsl:variable name=
"revauthor" select=
"authorinitials|author"/>
349 <xsl:variable name=
"revremark" select=
"revremark|revdescription"/>
352 <xsl:if test=
"$revnumber">
353 <xsl:call-template name=
"gentext">
354 <xsl:with-param name=
"key" select=
"'Revision'"/>
356 <xsl:call-template name=
"gentext.space"/>
357 <xsl:apply-templates select=
"$revnumber"/>
361 <xsl:apply-templates select=
"$revdate"/>
364 <xsl:when test=
"count($revauthor)=0">
366 <xsl:call-template name=
"dingbat">
367 <xsl:with-param name=
"dingbat">nbsp
</xsl:with-param>
373 <xsl:for-each select=
"$revauthor">
374 <xsl:apply-templates select=
"."/>
375 <xsl:if test=
"position() != last()">
376 <xsl:text>,
</xsl:text>
383 <xsl:if test=
"$revremark">
385 <td align=
"left" colspan=
"3">
386 <xsl:apply-templates select=
"$revremark"/>
392 <xsl:template match=
"revision/revnumber">
393 <xsl:apply-templates/>
396 <xsl:template match=
"revision/date">
397 <xsl:apply-templates/>
400 <xsl:template match=
"revision/authorinitials">
401 <xsl:text>,
</xsl:text>
402 <xsl:apply-templates/>
405 <xsl:template match=
"revision/authorinitials[1]" priority=
"2">
406 <xsl:apply-templates/>
409 <xsl:template match=
"revision/revremark">
410 <xsl:apply-templates/>
413 <xsl:template match=
"revision/revdescription">
414 <xsl:apply-templates/>
417 <!-- ==================================================================== -->
419 <xsl:template match=
"ackno">
421 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
422 <xsl:apply-templates/>
426 <!-- ==================================================================== -->
428 <xsl:template match=
"highlights">
429 <xsl:call-template name=
"block.object"/>
432 <!-- ==================================================================== -->