| 1 |
<?xml version='1.0'?> |
| 2 |
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
| 3 |
version='1.0'> |
| 4 |
|
| 5 |
<!-- ******************************************************************** |
| 6 |
$Id: block.xsl 6910 2007-06-28 23:23:30Z xmldoc $ |
| 7 |
******************************************************************** |
| 8 |
|
| 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. |
| 12 |
|
| 13 |
******************************************************************** --> |
| 14 |
|
| 15 |
<!-- ==================================================================== --> |
| 16 |
<!-- What should we do about styling blockinfo? --> |
| 17 |
|
| 18 |
<xsl:template match="blockinfo|info"> |
| 19 |
<!-- suppress --> |
| 20 |
</xsl:template> |
| 21 |
|
| 22 |
<!-- ==================================================================== --> |
| 23 |
|
| 24 |
<xsl:template name="block.object"> |
| 25 |
<div> |
| 26 |
<xsl:apply-templates select="." mode="class.attribute"/> |
| 27 |
<xsl:call-template name="anchor"/> |
| 28 |
<xsl:apply-templates/> |
| 29 |
</div> |
| 30 |
</xsl:template> |
| 31 |
|
| 32 |
<!-- ==================================================================== --> |
| 33 |
|
| 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"/> |
| 39 |
</xsl:if> |
| 40 |
</xsl:with-param> |
| 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"/> |
| 45 |
</xsl:call-template> |
| 46 |
</xsl:if> |
| 47 |
|
| 48 |
<xsl:call-template name="anchor"/> |
| 49 |
<xsl:apply-templates/> |
| 50 |
</xsl:with-param> |
| 51 |
</xsl:call-template> |
| 52 |
</xsl:template> |
| 53 |
|
| 54 |
<xsl:template name="paragraph"> |
| 55 |
<xsl:param name="class" select="''"/> |
| 56 |
<xsl:param name="content"/> |
| 57 |
|
| 58 |
<xsl:variable name="p"> |
| 59 |
<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> |
| 65 |
</xsl:if> |
| 66 |
<xsl:copy-of select="$content"/> |
| 67 |
</p> |
| 68 |
</xsl:variable> |
| 69 |
|
| 70 |
<xsl:choose> |
| 71 |
<xsl:when test="$html.cleanup != 0"> |
| 72 |
<xsl:call-template name="unwrap.p"> |
| 73 |
<xsl:with-param name="p" select="$p"/> |
| 74 |
</xsl:call-template> |
| 75 |
</xsl:when> |
| 76 |
<xsl:otherwise> |
| 77 |
<xsl:copy-of select="$p"/> |
| 78 |
</xsl:otherwise> |
| 79 |
</xsl:choose> |
| 80 |
</xsl:template> |
| 81 |
|
| 82 |
<xsl:template match="simpara"> |
| 83 |
<!-- see also listitem/simpara in lists.xsl --> |
| 84 |
<p> |
| 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> |
| 89 |
</xsl:if> |
| 90 |
|
| 91 |
<xsl:call-template name="anchor"/> |
| 92 |
<xsl:apply-templates/> |
| 93 |
</p> |
| 94 |
</xsl:template> |
| 95 |
|
| 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"/> |
| 101 |
</xsl:if> |
| 102 |
</xsl:with-param> |
| 103 |
<xsl:with-param name="content"> |
| 104 |
<xsl:call-template name="anchor"/> |
| 105 |
<xsl:apply-templates/> |
| 106 |
</xsl:with-param> |
| 107 |
</xsl:call-template> |
| 108 |
</xsl:template> |
| 109 |
|
| 110 |
<!-- Only use title from info --> |
| 111 |
<xsl:template match="formalpara/info"> |
| 112 |
<xsl:apply-templates select="title"/> |
| 113 |
</xsl:template> |
| 114 |
|
| 115 |
<xsl:template match="formalpara/title|formalpara/info/title"> |
| 116 |
<xsl:variable name="titleStr"> |
| 117 |
<xsl:apply-templates/> |
| 118 |
</xsl:variable> |
| 119 |
<xsl:variable name="lastChar"> |
| 120 |
<xsl:if test="$titleStr != ''"> |
| 121 |
<xsl:value-of select="substring($titleStr,string-length($titleStr),1)"/> |
| 122 |
</xsl:if> |
| 123 |
</xsl:variable> |
| 124 |
|
| 125 |
<b> |
| 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"/> |
| 130 |
</xsl:if> |
| 131 |
<xsl:text> </xsl:text> |
| 132 |
</b> |
| 133 |
</xsl:template> |
| 134 |
|
| 135 |
<xsl:template match="formalpara/para"> |
| 136 |
<xsl:apply-templates/> |
| 137 |
</xsl:template> |
| 138 |
|
| 139 |
<!-- ==================================================================== --> |
| 140 |
|
| 141 |
<xsl:template match="blockquote"> |
| 142 |
<div> |
| 143 |
<xsl:apply-templates select="." mode="class.attribute"/> |
| 144 |
<xsl:if test="@lang or @xml:lang"> |
| 145 |
<xsl:call-template name="language.attribute"/> |
| 146 |
</xsl:if> |
| 147 |
<xsl:call-template name="anchor"/> |
| 148 |
|
| 149 |
<xsl:choose> |
| 150 |
<xsl:when test="attribution"> |
| 151 |
<table border="0" width="100%" |
| 152 |
cellspacing="0" cellpadding="0" class="blockquote" |
| 153 |
summary="Block quote"> |
| 154 |
<tr> |
| 155 |
<td width="10%" valign="top"> </td> |
| 156 |
<td width="80%" valign="top"> |
| 157 |
<xsl:apply-templates select="child::*[local-name(.)!='attribution']"/> |
| 158 |
</td> |
| 159 |
<td width="10%" valign="top"> </td> |
| 160 |
</tr> |
| 161 |
<tr> |
| 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"/> |
| 166 |
</td> |
| 167 |
</tr> |
| 168 |
</table> |
| 169 |
</xsl:when> |
| 170 |
<xsl:otherwise> |
| 171 |
<blockquote> |
| 172 |
<xsl:apply-templates select="." mode="class.attribute"/> |
| 173 |
<xsl:apply-templates/> |
| 174 |
</blockquote> |
| 175 |
</xsl:otherwise> |
| 176 |
</xsl:choose> |
| 177 |
</div> |
| 178 |
</xsl:template> |
| 179 |
|
| 180 |
<xsl:template match="blockquote/title|blockquote/info/title"> |
| 181 |
<div class="blockquote-title"> |
| 182 |
<p> |
| 183 |
<b> |
| 184 |
<xsl:apply-templates/> |
| 185 |
</b> |
| 186 |
</p> |
| 187 |
</div> |
| 188 |
</xsl:template> |
| 189 |
|
| 190 |
<xsl:template match="epigraph"> |
| 191 |
<div> |
| 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> |
| 197 |
</div> |
| 198 |
</xsl:if> |
| 199 |
</div> |
| 200 |
</xsl:template> |
| 201 |
|
| 202 |
<xsl:template match="attribution"> |
| 203 |
<span> |
| 204 |
<xsl:apply-templates select="." mode="class.attribute"/> |
| 205 |
<xsl:apply-templates/> |
| 206 |
</span> |
| 207 |
</xsl:template> |
| 208 |
|
| 209 |
<!-- ==================================================================== --> |
| 210 |
|
| 211 |
<xsl:template match="abstract|sidebar"> |
| 212 |
<div> |
| 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> |
| 220 |
</xsl:with-param> |
| 221 |
</xsl:call-template> |
| 222 |
<xsl:apply-templates/> |
| 223 |
</div> |
| 224 |
</xsl:template> |
| 225 |
|
| 226 |
<xsl:template match="abstract/title|sidebar/title"> |
| 227 |
</xsl:template> |
| 228 |
|
| 229 |
<xsl:template match="sidebar/sidebarinfo|sidebar/info"/> |
| 230 |
|
| 231 |
<!-- ==================================================================== --> |
| 232 |
|
| 233 |
<xsl:template match="msgset"> |
| 234 |
<xsl:apply-templates/> |
| 235 |
</xsl:template> |
| 236 |
|
| 237 |
<xsl:template match="msgentry"> |
| 238 |
<xsl:call-template name="block.object"/> |
| 239 |
</xsl:template> |
| 240 |
|
| 241 |
<xsl:template match="simplemsgentry"> |
| 242 |
<xsl:call-template name="block.object"/> |
| 243 |
</xsl:template> |
| 244 |
|
| 245 |
<xsl:template match="msg"> |
| 246 |
<xsl:call-template name="block.object"/> |
| 247 |
</xsl:template> |
| 248 |
|
| 249 |
<xsl:template match="msgmain"> |
| 250 |
<xsl:apply-templates/> |
| 251 |
</xsl:template> |
| 252 |
|
| 253 |
<xsl:template match="msgmain/title"> |
| 254 |
<b><xsl:apply-templates/></b> |
| 255 |
</xsl:template> |
| 256 |
|
| 257 |
<xsl:template match="msgsub"> |
| 258 |
<xsl:apply-templates/> |
| 259 |
</xsl:template> |
| 260 |
|
| 261 |
<xsl:template match="msgsub/title"> |
| 262 |
<b><xsl:apply-templates/></b> |
| 263 |
</xsl:template> |
| 264 |
|
| 265 |
<xsl:template match="msgrel"> |
| 266 |
<xsl:apply-templates/> |
| 267 |
</xsl:template> |
| 268 |
|
| 269 |
<xsl:template match="msgrel/title"> |
| 270 |
<b><xsl:apply-templates/></b> |
| 271 |
</xsl:template> |
| 272 |
|
| 273 |
<xsl:template match="msgtext"> |
| 274 |
<xsl:apply-templates/> |
| 275 |
</xsl:template> |
| 276 |
|
| 277 |
<xsl:template match="msginfo"> |
| 278 |
<xsl:call-template name="block.object"/> |
| 279 |
</xsl:template> |
| 280 |
|
| 281 |
<xsl:template match="msglevel"> |
| 282 |
<p> |
| 283 |
<b> |
| 284 |
<xsl:call-template name="gentext.template"> |
| 285 |
<xsl:with-param name="context" select="'msgset'"/> |
| 286 |
<xsl:with-param name="name" select="'MsgLevel'"/> |
| 287 |
</xsl:call-template> |
| 288 |
</b> |
| 289 |
<xsl:apply-templates/> |
| 290 |
</p> |
| 291 |
</xsl:template> |
| 292 |
|
| 293 |
<xsl:template match="msgorig"> |
| 294 |
<p> |
| 295 |
<b> |
| 296 |
<xsl:call-template name="gentext.template"> |
| 297 |
<xsl:with-param name="context" select="'msgset'"/> |
| 298 |
<xsl:with-param name="name" select="'MsgOrig'"/> |
| 299 |
</xsl:call-template> |
| 300 |
</b> |
| 301 |
<xsl:apply-templates/> |
| 302 |
</p> |
| 303 |
</xsl:template> |
| 304 |
|
| 305 |
<xsl:template match="msgaud"> |
| 306 |
<p> |
| 307 |
<b> |
| 308 |
<xsl:call-template name="gentext.template"> |
| 309 |
<xsl:with-param name="context" select="'msgset'"/> |
| 310 |
<xsl:with-param name="name" select="'MsgAud'"/> |
| 311 |
</xsl:call-template> |
| 312 |
</b> |
| 313 |
<xsl:apply-templates/> |
| 314 |
</p> |
| 315 |
</xsl:template> |
| 316 |
|
| 317 |
<xsl:template match="msgexplan"> |
| 318 |
<xsl:call-template name="block.object"/> |
| 319 |
</xsl:template> |
| 320 |
|
| 321 |
<xsl:template match="msgexplan/title"> |
| 322 |
<p><b><xsl:apply-templates/></b></p> |
| 323 |
</xsl:template> |
| 324 |
|
| 325 |
<!-- ==================================================================== --> |
| 326 |
|
| 327 |
<xsl:template match="revhistory"> |
| 328 |
<div> |
| 329 |
<xsl:apply-templates select="." mode="class.attribute"/> |
| 330 |
<table border="0" width="100%" summary="Revision history"> |
| 331 |
<tr> |
| 332 |
<th align="left" valign="top" colspan="3"> |
| 333 |
<b> |
| 334 |
<xsl:call-template name="gentext"> |
| 335 |
<xsl:with-param name="key" select="'RevHistory'"/> |
| 336 |
</xsl:call-template> |
| 337 |
</b> |
| 338 |
</th> |
| 339 |
</tr> |
| 340 |
<xsl:apply-templates/> |
| 341 |
</table> |
| 342 |
</div> |
| 343 |
</xsl:template> |
| 344 |
|
| 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"/> |
| 350 |
<tr> |
| 351 |
<td align="left"> |
| 352 |
<xsl:if test="$revnumber"> |
| 353 |
<xsl:call-template name="gentext"> |
| 354 |
<xsl:with-param name="key" select="'Revision'"/> |
| 355 |
</xsl:call-template> |
| 356 |
<xsl:call-template name="gentext.space"/> |
| 357 |
<xsl:apply-templates select="$revnumber"/> |
| 358 |
</xsl:if> |
| 359 |
</td> |
| 360 |
<td align="left"> |
| 361 |
<xsl:apply-templates select="$revdate"/> |
| 362 |
</td> |
| 363 |
<xsl:choose> |
| 364 |
<xsl:when test="count($revauthor)=0"> |
| 365 |
<td align="left"> |
| 366 |
<xsl:call-template name="dingbat"> |
| 367 |
<xsl:with-param name="dingbat">nbsp</xsl:with-param> |
| 368 |
</xsl:call-template> |
| 369 |
</td> |
| 370 |
</xsl:when> |
| 371 |
<xsl:otherwise> |
| 372 |
<td align="left"> |
| 373 |
<xsl:for-each select="$revauthor"> |
| 374 |
<xsl:apply-templates select="."/> |
| 375 |
<xsl:if test="position() != last()"> |
| 376 |
<xsl:text>, </xsl:text> |
| 377 |
</xsl:if> |
| 378 |
</xsl:for-each> |
| 379 |
</td> |
| 380 |
</xsl:otherwise> |
| 381 |
</xsl:choose> |
| 382 |
</tr> |
| 383 |
<xsl:if test="$revremark"> |
| 384 |
<tr> |
| 385 |
<td align="left" colspan="3"> |
| 386 |
<xsl:apply-templates select="$revremark"/> |
| 387 |
</td> |
| 388 |
</tr> |
| 389 |
</xsl:if> |
| 390 |
</xsl:template> |
| 391 |
|
| 392 |
<xsl:template match="revision/revnumber"> |
| 393 |
<xsl:apply-templates/> |
| 394 |
</xsl:template> |
| 395 |
|
| 396 |
<xsl:template match="revision/date"> |
| 397 |
<xsl:apply-templates/> |
| 398 |
</xsl:template> |
| 399 |
|
| 400 |
<xsl:template match="revision/authorinitials"> |
| 401 |
<xsl:text>, </xsl:text> |
| 402 |
<xsl:apply-templates/> |
| 403 |
</xsl:template> |
| 404 |
|
| 405 |
<xsl:template match="revision/authorinitials[1]" priority="2"> |
| 406 |
<xsl:apply-templates/> |
| 407 |
</xsl:template> |
| 408 |
|
| 409 |
<xsl:template match="revision/revremark"> |
| 410 |
<xsl:apply-templates/> |
| 411 |
</xsl:template> |
| 412 |
|
| 413 |
<xsl:template match="revision/revdescription"> |
| 414 |
<xsl:apply-templates/> |
| 415 |
</xsl:template> |
| 416 |
|
| 417 |
<!-- ==================================================================== --> |
| 418 |
|
| 419 |
<xsl:template match="ackno"> |
| 420 |
<p> |
| 421 |
<xsl:apply-templates select="." mode="class.attribute"/> |
| 422 |
<xsl:apply-templates/> |
| 423 |
</p> |
| 424 |
</xsl:template> |
| 425 |
|
| 426 |
<!-- ==================================================================== --> |
| 427 |
|
| 428 |
<xsl:template match="highlights"> |
| 429 |
<xsl:call-template name="block.object"/> |
| 430 |
</xsl:template> |
| 431 |
|
| 432 |
<!-- ==================================================================== --> |
| 433 |
|
| 434 |
</xsl:stylesheet> |