2 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
5 <!-- ********************************************************************
6 $Id: block.xsl 8441 2009-05-24 02:14:56Z abdelazer $
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:copy-of select="$titleStr"/>
132 <xsl:if test="$lastChar != ''
133 and not(contains($runinhead.title.end.punct, $lastChar))">
134 <xsl:value-of select="$runinhead.default.title.end.punct"/>
136 <xsl:text> </xsl:text>
140 <xsl:template match="formalpara/para">
141 <xsl:apply-templates/>
144 <!-- ==================================================================== -->
146 <xsl:template match="blockquote">
148 <xsl:call-template name="common.html.attributes"/>
149 <xsl:call-template name="anchor"/>
152 <xsl:when test="attribution">
153 <table border="0" width="100%"
154 cellspacing="0" cellpadding="0" class="blockquote"
155 summary="Block quote">
157 <td width="10%" valign="top"> </td>
158 <td width="80%" valign="top">
159 <xsl:apply-templates select="child::*[local-name(.)!='attribution']"/>
161 <td width="10%" valign="top"> </td>
164 <td width="10%" valign="top"> </td>
165 <td colspan="2" align="{$direction.align.end}" valign="top">
166 <xsl:text>--</xsl:text>
167 <xsl:apply-templates select="attribution"/>
174 <xsl:call-template name="common.html.attributes"/>
175 <xsl:apply-templates/>
182 <xsl:template match="blockquote/title|blockquote/info/title">
183 <div class="blockquote-title">
186 <xsl:apply-templates/>
192 <!-- 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 -->
193 <xsl:template match="epigraph">
195 <xsl:call-template name="common.html.attributes"/>
196 <xsl:apply-templates select="para|simpara|formalpara|literallayout"/>
197 <xsl:if test="attribution">
198 <div class="attribution">
199 <span>—<xsl:apply-templates select="attribution"/></span>
205 <xsl:template match="attribution">
207 <xsl:call-template name="common.html.attributes"/>
208 <xsl:apply-templates/>
212 <!-- ==================================================================== -->
214 <xsl:template match="abstract|sidebar">
216 <xsl:call-template name="common.html.attributes"/>
217 <xsl:call-template name="anchor"/>
218 <xsl:call-template name="formal.object.heading">
219 <xsl:with-param name="title">
220 <xsl:apply-templates select="." mode="title.markup">
221 <xsl:with-param name="allow-anchors" select="'1'"/>
222 </xsl:apply-templates>
225 <xsl:apply-templates/>
229 <xsl:template match="abstract/title|sidebar/title">
232 <xsl:template match="sidebar/sidebarinfo|sidebar/info"/>
234 <!-- ==================================================================== -->
236 <xsl:template match="msgset">
237 <xsl:apply-templates/>
240 <xsl:template match="msgentry">
241 <xsl:call-template name="block.object"/>
244 <xsl:template match="simplemsgentry">
245 <xsl:call-template name="block.object"/>
248 <xsl:template match="msg">
249 <xsl:call-template name="block.object"/>
252 <xsl:template match="msgmain">
253 <xsl:apply-templates/>
256 <xsl:template match="msgmain/title">
257 <b><xsl:apply-templates/></b>
260 <xsl:template match="msgsub">
261 <xsl:apply-templates/>
264 <xsl:template match="msgsub/title">
265 <b><xsl:apply-templates/></b>
268 <xsl:template match="msgrel">
269 <xsl:apply-templates/>
272 <xsl:template match="msgrel/title">
273 <b><xsl:apply-templates/></b>
276 <xsl:template match="msgtext">
277 <xsl:apply-templates/>
280 <xsl:template match="msginfo">
281 <xsl:call-template name="block.object"/>
284 <xsl:template match="msglevel">
287 <xsl:call-template name="gentext.template">
288 <xsl:with-param name="context" select="'msgset'"/>
289 <xsl:with-param name="name" select="'MsgLevel'"/>
292 <xsl:apply-templates/>
296 <xsl:template match="msgorig">
299 <xsl:call-template name="gentext.template">
300 <xsl:with-param name="context" select="'msgset'"/>
301 <xsl:with-param name="name" select="'MsgOrig'"/>
304 <xsl:apply-templates/>
308 <xsl:template match="msgaud">
311 <xsl:call-template name="gentext.template">
312 <xsl:with-param name="context" select="'msgset'"/>
313 <xsl:with-param name="name" select="'MsgAud'"/>
316 <xsl:apply-templates/>
320 <xsl:template match="msgexplan">
321 <xsl:call-template name="block.object"/>
324 <xsl:template match="msgexplan/title">
325 <p><b><xsl:apply-templates/></b></p>
328 <!-- ==================================================================== -->
330 <xsl:template match="revhistory">
332 <xsl:call-template name="common.html.attributes"/>
333 <table border="0" width="100%" summary="Revision history">
335 <th align="{$direction.align.start}" valign="top" colspan="3">
337 <xsl:call-template name="gentext">
338 <xsl:with-param name="key" select="'RevHistory'"/>
343 <xsl:apply-templates/>
348 <xsl:template match="revhistory/revision">
349 <xsl:variable name="revnumber" select="revnumber"/>
350 <xsl:variable name="revdate" select="date"/>
351 <xsl:variable name="revauthor" select="authorinitials|author"/>
352 <xsl:variable name="revremark" select="revremark|revdescription"/>
354 <td align="{$direction.align.start}">
355 <xsl:if test="$revnumber">
356 <xsl:call-template name="gentext">
357 <xsl:with-param name="key" select="'Revision'"/>
359 <xsl:call-template name="gentext.space"/>
360 <xsl:apply-templates select="$revnumber"/>
363 <td align="{$direction.align.start}">
364 <xsl:apply-templates select="$revdate"/>
367 <xsl:when test="count($revauthor)=0">
368 <td align="{$direction.align.start}">
369 <xsl:call-template name="dingbat">
370 <xsl:with-param name="dingbat">nbsp</xsl:with-param>
375 <td align="{$direction.align.start}">
376 <xsl:for-each select="$revauthor">
377 <xsl:apply-templates select="."/>
378 <xsl:if test="position() != last()">
379 <xsl:text>, </xsl:text>
386 <xsl:if test="$revremark">
388 <td align="{$direction.align.start}" colspan="3">
389 <xsl:apply-templates select="$revremark"/>
395 <xsl:template match="revision/revnumber">
396 <xsl:apply-templates/>
399 <xsl:template match="revision/date">
400 <xsl:apply-templates/>
403 <xsl:template match="revision/authorinitials">
404 <xsl:text>, </xsl:text>
405 <xsl:apply-templates/>
408 <xsl:template match="revision/authorinitials[1]" priority="2">
409 <xsl:apply-templates/>
412 <xsl:template match="revision/revremark">
413 <xsl:apply-templates/>
416 <xsl:template match="revision/revdescription">
417 <xsl:apply-templates/>
420 <!-- ==================================================================== -->
422 <xsl:template match="ackno|acknowledgements[parent::article]">
424 <xsl:call-template name="common.html.attributes"/>
425 <xsl:apply-templates/>
429 <!-- ==================================================================== -->
431 <xsl:template match="highlights">
432 <xsl:call-template name="block.object"/>
435 <!-- ==================================================================== -->