1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346
|
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
version='1.0'>
<!-- ********************************************************************
$Id: block.xsl,v 1.3 2004/10/01 16:32:07 techtonik Exp $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://nwalsh.com/docbook/xsl/ for copyright
and other information.
******************************************************************** -->
<!-- ==================================================================== -->
<!-- What should we do about styling blockinfo? -->
<xsl:template match="blockinfo">
<!-- suppress -->
</xsl:template>
<!-- ==================================================================== -->
<xsl:template name="block.object">
<fo:block>
<xsl:apply-templates/>
</fo:block>
</xsl:template>
<!-- ==================================================================== -->
<xsl:template match="para">
<fo:block xsl:use-attribute-sets="normal.para.spacing">
<xsl:call-template name="anchor"/>
<xsl:apply-templates/>
</fo:block>
</xsl:template>
<xsl:template match="simpara">
<fo:block xsl:use-attribute-sets="normal.para.spacing">
<xsl:apply-templates/>
</fo:block>
</xsl:template>
<xsl:template match="formalpara">
<fo:block xsl:use-attribute-sets="normal.para.spacing">
<xsl:apply-templates/>
</fo:block>
</xsl:template>
<xsl:template match="formalpara/title">
<xsl:variable name="titleStr">
<xsl:apply-templates/>
</xsl:variable>
<xsl:variable name="lastChar">
<xsl:if test="$titleStr != ''">
<xsl:value-of select="substring($titleStr,string-length($titleStr),1)"/>
</xsl:if>
</xsl:variable>
<fo:inline font-weight="bold"
keep-with-next.within-line="always"
padding-end="1em">
<xsl:copy-of select="$titleStr"/>
<xsl:if test="$lastChar != ''
and not(contains($runinhead.title.end.punct, $lastChar))">
<xsl:value-of select="$runinhead.default.title.end.punct"/>
</xsl:if>
<xsl:text> </xsl:text>
</fo:inline>
</xsl:template>
<xsl:template match="formalpara/para">
<xsl:apply-templates/>
</xsl:template>
<!-- ==================================================================== -->
<xsl:template match="blockquote">
<fo:block xsl:use-attribute-sets="blockquote.properties">
<xsl:call-template name="anchor"/>
<fo:block>
<xsl:if test="title">
<fo:block xsl:use-attribute-sets="formal.title.properties">
<xsl:apply-templates select="." mode="object.title.markup"/>
</fo:block>
</xsl:if>
<xsl:apply-templates select="*[local-name(.) != 'title'
and local-name(.) != 'attribution']"/>
</fo:block>
<xsl:if test="attribution">
<fo:block text-align="right">
<!-- mdash -->
<xsl:text>—</xsl:text>
<xsl:apply-templates select="attribution"/>
</fo:block>
</xsl:if>
</fo:block>
</xsl:template>
<xsl:template match="epigraph">
<fo:block>
<xsl:call-template name="anchor"/>
<xsl:apply-templates select="para|simpara|formalpara|literallayout"/>
<xsl:if test="attribution">
<fo:inline>
<xsl:text>--</xsl:text>
<xsl:apply-templates select="attribution"/>
</fo:inline>
</xsl:if>
</fo:block>
</xsl:template>
<xsl:template match="attribution">
<fo:inline><xsl:apply-templates/></fo:inline>
</xsl:template>
<!-- ==================================================================== -->
<xsl:template match="sidebar">
<fo:block xsl:use-attribute-sets="sidebar.properties">
<xsl:if test="./title">
<fo:block font-weight="bold"
keep-with-next.within-column="always"
hyphenate="false">
<xsl:apply-templates select="./title" mode="sidebar.title.mode"/>
</fo:block>
</xsl:if>
<xsl:apply-templates/>
</fo:block>
</xsl:template>
<xsl:template match="sidebar/title">
</xsl:template>
<xsl:template match="sidebar/title" mode="sidebar.title.mode">
<xsl:apply-templates/>
</xsl:template>
<!-- ==================================================================== -->
<xsl:template match="abstract">
<fo:block>
<xsl:if test="@id">
<xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
</xsl:if>
<xsl:if test="title">
<xsl:call-template name="formal.object.heading"/>
</xsl:if>
<xsl:apply-templates/>
</fo:block>
</xsl:template>
<xsl:template match="abstract/title">
</xsl:template>
<!-- ==================================================================== -->
<xsl:template match="msgset">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="msgentry">
<xsl:call-template name="block.object"/>
</xsl:template>
<xsl:template match="simplemsgentry">
<xsl:call-template name="block.object"/>
</xsl:template>
<xsl:template match="msg">
<xsl:call-template name="block.object"/>
</xsl:template>
<xsl:template match="msgmain">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="msgsub">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="msgrel">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="msgtext">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="msginfo">
<xsl:call-template name="block.object"/>
</xsl:template>
<xsl:template match="msglevel">
<fo:block>
<fo:inline font-weight="bold"
keep-with-next.within-line="always">
<xsl:call-template name="gentext.template">
<xsl:with-param name="context" select="'msgset'"/>
<xsl:with-param name="name" select="'MsgLevel'"/>
</xsl:call-template>
</fo:inline>
<xsl:apply-templates/>
</fo:block>
</xsl:template>
<xsl:template match="msgorig">
<fo:block>
<fo:inline font-weight="bold"
keep-with-next.within-line="always">
<xsl:call-template name="gentext.template">
<xsl:with-param name="context" select="'msgset'"/>
<xsl:with-param name="name" select="'MsgOrig'"/>
</xsl:call-template>
</fo:inline>
<xsl:apply-templates/>
</fo:block>
</xsl:template>
<xsl:template match="msgaud">
<fo:block>
<fo:inline font-weight="bold"
keep-with-next.within-line="always">
<xsl:call-template name="gentext.template">
<xsl:with-param name="context" select="'msgset'"/>
<xsl:with-param name="name" select="'MsgAud'"/>
</xsl:call-template>
</fo:inline>
<xsl:apply-templates/>
</fo:block>
</xsl:template>
<xsl:template match="msgexplan">
<xsl:call-template name="block.object"/>
</xsl:template>
<xsl:template match="msgexplan/title">
<fo:block font-weight="bold"
keep-with-next.within-column="always"
hyphenate="false">
<xsl:apply-templates/>
</fo:block>
</xsl:template>
<!-- ==================================================================== -->
<!-- For better or worse, revhistory is allowed in content... -->
<xsl:template match="revhistory">
<fo:table table-layout="fixed">
<fo:table-column column-number="1" column-width="proportional-column-width(1)"/>
<fo:table-column column-number="2" column-width="proportional-column-width(1)"/>
<fo:table-column column-number="3" column-width="proportional-column-width(1)"/>
<fo:table-body>
<fo:table-row>
<fo:table-cell number-columns-spanned="3">
<fo:block>
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'RevHistory'"/>
</xsl:call-template>
</fo:block>
</fo:table-cell>
</fo:table-row>
<xsl:apply-templates/>
</fo:table-body>
</fo:table>
</xsl:template>
<xsl:template match="revhistory/revision">
<xsl:variable name="revnumber" select=".//revnumber"/>
<xsl:variable name="revdate" select=".//date"/>
<xsl:variable name="revauthor" select=".//authorinitials"/>
<xsl:variable name="revremark" select=".//revremark|.//revdescription"/>
<fo:table-row>
<fo:table-cell>
<fo:block>
<xsl:if test="$revnumber">
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'Revision'"/>
</xsl:call-template>
<xsl:call-template name="gentext.space"/>
<xsl:apply-templates select="$revnumber[1]"/>
</xsl:if>
</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block>
<xsl:apply-templates select="$revdate[1]"/>
</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block>
<xsl:apply-templates select="$revauthor[1]"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
<xsl:if test="$revremark">
<fo:table-row>
<fo:table-cell number-columns-spanned="3">
<fo:block>
<xsl:apply-templates select="$revremark[1]"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
</xsl:if>
</xsl:template>
<xsl:template match="revision/revnumber">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="revision/date">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="revision/authorinitials">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="revision/revremark">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="revision/revdescription">
<xsl:apply-templates/>
</xsl:template>
<!-- ==================================================================== -->
<xsl:template match="ackno">
<fo:block xsl:use-attribute-sets="normal.para.spacing">
<xsl:apply-templates/>
</fo:block>
</xsl:template>
<!-- ==================================================================== -->
<xsl:template match="highlights">
<xsl:call-template name="block.object"/>
</xsl:template>
<!-- ==================================================================== -->
</xsl:stylesheet>
|