2 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
5 <!-- ********************************************************************
6 $Id: block.xsl 8831 2010-08-13 17:08:49Z mzjn $
7 ********************************************************************
9 This file is part of the XSL DocBook Stylesheet distribution.
10 See ../README or http://docbook.sf.net/release/xsl/current/ for
11 copyright 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:call-template name="common.html.attributes"/>
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">
61 <xsl:when test="$class != ''">
62 <xsl:call-template name="common.html.attributes">
63 <xsl:with-param name="class" select="$class"/>
67 <xsl:call-template name="locale.html.attributes"/>
70 <xsl:copy-of select="$content"/>
75 <xsl:when test="$html.cleanup != 0">
76 <xsl:call-template name="unwrap.p">
77 <xsl:with-param name="p" select="$p"/>
81 <xsl:copy-of select="$p"/>
86 <xsl:template match="simpara">
87 <!-- see also listitem/simpara in lists.xsl -->
89 <xsl:call-template name="locale.html.attributes"/>
90 <xsl:if test="@role and $para.propagates.style != 0">
91 <xsl:apply-templates select="." mode="class.attribute">
92 <xsl:with-param name="class" select="@role"/>
93 </xsl:apply-templates>
96 <xsl:call-template name="anchor"/>
97 <xsl:apply-templates/>
101 <xsl:template match="formalpara">
102 <xsl:call-template name="paragraph">
103 <xsl:with-param name="class">
104 <xsl:if test="@role and $para.propagates.style != 0">
105 <xsl:value-of select="@role"/>
108 <xsl:with-param name="content">
109 <xsl:call-template name="anchor"/>
110 <xsl:apply-templates/>
115 <!-- Only use title from info -->
116 <xsl:template match="formalpara/info">
117 <xsl:apply-templates select="title"/>
120 <xsl:template match="formalpara/title|formalpara/info/title">
121 <xsl:variable name="titleStr">
122 <xsl:apply-templates/>
124 <xsl:variable name="lastChar">
125 <xsl:if test="$titleStr != ''">
126 <xsl:value-of select="substring($titleStr,string-length($titleStr),1)"/>
131 <xsl:when test="$make.clean.html != 0">
132 <span class="formalpara-title">
133 <xsl:copy-of select="$titleStr"/>
134 <xsl:if test="$lastChar != ''
135 and not(contains($runinhead.title.end.punct, $lastChar))">
136 <xsl:value-of select="$runinhead.default.title.end.punct"/>
138 <xsl:text> </xsl:text>
143 <xsl:copy-of select="$titleStr"/>
144 <xsl:if test="$lastChar != ''
145 and not(contains($runinhead.title.end.punct, $lastChar))">
146 <xsl:value-of select="$runinhead.default.title.end.punct"/>
148 <xsl:text> </xsl:text>
154 <xsl:template match="formalpara/para">
155 <xsl:apply-templates/>
158 <!-- ==================================================================== -->
160 <xsl:template match="blockquote">
162 <xsl:call-template name="common.html.attributes"/>
163 <xsl:call-template name="anchor"/>
166 <xsl:when test="attribution">
167 <table border="0" width="100%"
168 cellspacing="0" cellpadding="0" class="blockquote"
169 summary="Block quote">
171 <td width="10%" valign="top"> </td>
172 <td width="80%" valign="top">
173 <xsl:apply-templates select="child::*[local-name(.)!='attribution']"/>
175 <td width="10%" valign="top"> </td>
178 <td width="10%" valign="top"> </td>
179 <td colspan="2" align="{$direction.align.end}" valign="top">
180 <xsl:text>--</xsl:text>
181 <xsl:apply-templates select="attribution"/>
188 <xsl:call-template name="common.html.attributes"/>
189 <xsl:apply-templates/>
196 <xsl:template match="blockquote/title|blockquote/info/title">
198 <xsl:when test="$make.clean.html != 0">
199 <div class="blockquote-title">
200 <xsl:apply-templates/>
204 <div class="blockquote-title">
207 <xsl:apply-templates/>
215 <!-- Use an em dash per Chicago Manual of Style and https://sourceforge.net/tracker/index.php?func=detail&aid=2793878&group_id=21935&atid=373747 -->
216 <xsl:template match="epigraph">
218 <xsl:call-template name="common.html.attributes"/>
219 <xsl:apply-templates select="para|simpara|formalpara|literallayout"/>
220 <xsl:if test="attribution">
221 <div class="attribution">
222 <span>—<xsl:apply-templates select="attribution"/></span>
228 <xsl:template match="attribution">
230 <xsl:call-template name="common.html.attributes"/>
231 <xsl:apply-templates/>
235 <!-- ==================================================================== -->
237 <xsl:template match="abstract|sidebar">
239 <xsl:call-template name="common.html.attributes"/>
240 <xsl:call-template name="anchor"/>
241 <xsl:call-template name="sidebar.titlepage"/>
242 <xsl:apply-templates/>
246 <xsl:template match="abstract/title|sidebar/title">
249 <xsl:template match="sidebar/sidebarinfo|sidebar/info"/>
251 <!-- ==================================================================== -->
253 <xsl:template match="msgset">
254 <xsl:apply-templates/>
257 <xsl:template match="msgentry">
258 <xsl:call-template name="block.object"/>
261 <xsl:template match="simplemsgentry">
262 <xsl:call-template name="block.object"/>
265 <xsl:template match="msg">
266 <xsl:call-template name="block.object"/>
269 <xsl:template match="msgmain">
270 <xsl:apply-templates/>
273 <xsl:template match="msgmain/title">
275 <xsl:when test="$make.clean.html != 0">
276 <span class="msgmain-title">
277 <xsl:apply-templates/>
281 <b><xsl:apply-templates/></b>
286 <xsl:template match="msgsub">
287 <xsl:apply-templates/>
290 <xsl:template match="msgsub/title">
292 <xsl:when test="$make.clean.html != 0">
293 <span class="msgsub-title">
294 <xsl:apply-templates/>
298 <b><xsl:apply-templates/></b>
303 <xsl:template match="msgrel">
304 <xsl:apply-templates/>
307 <xsl:template match="msgrel/title">
309 <xsl:when test="$make.clean.html != 0">
310 <span class="msgrel-title">
311 <xsl:apply-templates/>
315 <b><xsl:apply-templates/></b>
320 <xsl:template match="msgtext">
321 <xsl:apply-templates/>
324 <xsl:template match="msginfo">
325 <xsl:call-template name="block.object"/>
328 <xsl:template match="msglevel">
330 <xsl:when test="$make.clean.html != 0">
331 <div class="msglevel">
332 <span class="msglevel-title">
333 <xsl:call-template name="gentext.template">
334 <xsl:with-param name="context" select="'msgset'"/>
335 <xsl:with-param name="name" select="'MsgLevel'"/>
338 <xsl:apply-templates/>
344 <xsl:call-template name="gentext.template">
345 <xsl:with-param name="context" select="'msgset'"/>
346 <xsl:with-param name="name" select="'MsgLevel'"/>
349 <xsl:apply-templates/>
355 <xsl:template match="msgorig">
357 <xsl:when test="$make.clean.html != 0">
358 <div class="msgorig">
359 <span class="msgorig-title">
360 <xsl:call-template name="gentext.template">
361 <xsl:with-param name="context" select="'msgset'"/>
362 <xsl:with-param name="name" select="'MsgOrig'"/>
365 <xsl:apply-templates/>
371 <xsl:call-template name="gentext.template">
372 <xsl:with-param name="context" select="'msgset'"/>
373 <xsl:with-param name="name" select="'MsgOrig'"/>
376 <xsl:apply-templates/>
382 <xsl:template match="msgaud">
384 <xsl:when test="$make.clean.html != 0">
386 <span class="msgaud-title">
387 <xsl:call-template name="gentext.template">
388 <xsl:with-param name="context" select="'msgset'"/>
389 <xsl:with-param name="name" select="'MsgAud'"/>
392 <xsl:apply-templates/>
398 <xsl:call-template name="gentext.template">
399 <xsl:with-param name="context" select="'msgset'"/>
400 <xsl:with-param name="name" select="'MsgAud'"/>
403 <xsl:apply-templates/>
409 <xsl:template match="msgexplan">
410 <xsl:call-template name="block.object"/>
413 <xsl:template match="msgexplan/title">
415 <xsl:when test="$make.clean.html != 0">
416 <div class="msgexplan">
417 <span class="msgexplan-title">
418 <xsl:apply-templates/>
425 <xsl:apply-templates/>
432 <!-- ==================================================================== -->
434 <xsl:template match="revhistory">
436 <xsl:call-template name="common.html.attributes"/>
437 <table border="0" width="100%" summary="Revision history">
439 <th align="{$direction.align.start}" valign="top" colspan="3">
441 <xsl:call-template name="gentext">
442 <xsl:with-param name="key" select="'RevHistory'"/>
447 <xsl:apply-templates/>
452 <xsl:template match="revhistory/revision">
453 <xsl:variable name="revnumber" select="revnumber"/>
454 <xsl:variable name="revdate" select="date"/>
455 <xsl:variable name="revauthor" select="authorinitials|author"/>
456 <xsl:variable name="revremark" select="revremark|revdescription"/>
458 <td align="{$direction.align.start}">
459 <xsl:if test="$revnumber">
460 <xsl:call-template name="gentext">
461 <xsl:with-param name="key" select="'Revision'"/>
463 <xsl:call-template name="gentext.space"/>
464 <xsl:apply-templates select="$revnumber"/>
467 <td align="{$direction.align.start}">
468 <xsl:apply-templates select="$revdate"/>
471 <xsl:when test="count($revauthor)=0">
472 <td align="{$direction.align.start}">
473 <xsl:call-template name="dingbat">
474 <xsl:with-param name="dingbat">nbsp</xsl:with-param>
479 <td align="{$direction.align.start}">
480 <xsl:for-each select="$revauthor">
481 <xsl:apply-templates select="."/>
482 <xsl:if test="position() != last()">
483 <xsl:text>, </xsl:text>
490 <xsl:if test="$revremark">
492 <td align="{$direction.align.start}" colspan="3">
493 <xsl:apply-templates select="$revremark"/>
499 <xsl:template match="revision/revnumber">
500 <xsl:apply-templates/>
503 <xsl:template match="revision/date">
504 <xsl:apply-templates/>
507 <xsl:template match="revision/authorinitials">
508 <xsl:text>, </xsl:text>
509 <xsl:apply-templates/>
512 <xsl:template match="revision/authorinitials[1]" priority="2">
513 <xsl:apply-templates/>
516 <xsl:template match="revision/revremark">
517 <xsl:apply-templates/>
520 <xsl:template match="revision/revdescription">
521 <xsl:apply-templates/>
524 <!-- ==================================================================== -->
526 <xsl:template match="ackno|acknowledgements[parent::article]">
527 <xsl:call-template name="block.object"/>
530 <!-- ==================================================================== -->
532 <xsl:template match="highlights">
533 <xsl:call-template name="block.object"/>
536 <!-- ==================================================================== -->