| 1 |
<?xml version='1.0'?> |
| 2 |
<xsl:stylesheet exclude-result-prefixes="d" |
| 3 |
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
| 4 |
xmlns:d="http://docbook.org/ns/docbook" |
| 5 |
xmlns:fo="http://www.w3.org/1999/XSL/Format" |
| 6 |
xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions" |
| 7 |
version='1.0'> |
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
<xsl:template match="d:section"> |
| 20 |
<xsl:choose> |
| 21 |
<xsl:when test="$rootid = @id or $rootid = @xml:id"> |
| 22 |
<xsl:call-template name="section.page.sequence"/> |
| 23 |
</xsl:when> |
| 24 |
<xsl:otherwise> |
| 25 |
<xsl:variable name="id"> |
| 26 |
<xsl:call-template name="object.id"/> |
| 27 |
</xsl:variable> |
| 28 |
|
| 29 |
<xsl:variable name="renderas"> |
| 30 |
<xsl:choose> |
| 31 |
<xsl:when test="@renderas = 'sect1'">1</xsl:when> |
| 32 |
<xsl:when test="@renderas = 'sect2'">2</xsl:when> |
| 33 |
<xsl:when test="@renderas = 'sect3'">3</xsl:when> |
| 34 |
<xsl:when test="@renderas = 'sect4'">4</xsl:when> |
| 35 |
<xsl:when test="@renderas = 'sect5'">5</xsl:when> |
| 36 |
<xsl:otherwise><xsl:value-of select="''"/></xsl:otherwise> |
| 37 |
</xsl:choose> |
| 38 |
</xsl:variable> |
| 39 |
|
| 40 |
<xsl:variable name="level"> |
| 41 |
<xsl:choose> |
| 42 |
<xsl:when test="$renderas != ''"> |
| 43 |
<xsl:value-of select="$renderas"/> |
| 44 |
</xsl:when> |
| 45 |
<xsl:otherwise> |
| 46 |
<xsl:call-template name="section.level"/> |
| 47 |
</xsl:otherwise> |
| 48 |
</xsl:choose> |
| 49 |
</xsl:variable> |
| 50 |
|
| 51 |
|
| 52 |
<xsl:choose> |
| 53 |
<xsl:when test="$level = 1"> |
| 54 |
<xsl:element name="fo:{$section.container.element}" |
| 55 |
use-attribute-sets="section.level1.properties"> |
| 56 |
<xsl:attribute name="id"><xsl:value-of |
| 57 |
select="$id"/></xsl:attribute> |
| 58 |
<xsl:call-template name="section.content"/> |
| 59 |
</xsl:element> |
| 60 |
</xsl:when> |
| 61 |
<xsl:when test="$level = 2"> |
| 62 |
<xsl:element name="fo:{$section.container.element}" |
| 63 |
use-attribute-sets="section.level2.properties"> |
| 64 |
<xsl:attribute name="id"><xsl:value-of |
| 65 |
select="$id"/></xsl:attribute> |
| 66 |
<xsl:call-template name="section.content"/> |
| 67 |
</xsl:element> |
| 68 |
</xsl:when> |
| 69 |
<xsl:when test="$level = 3"> |
| 70 |
<xsl:element name="fo:{$section.container.element}" |
| 71 |
use-attribute-sets="section.level3.properties"> |
| 72 |
<xsl:attribute name="id"><xsl:value-of |
| 73 |
select="$id"/></xsl:attribute> |
| 74 |
<xsl:call-template name="section.content"/> |
| 75 |
</xsl:element> |
| 76 |
</xsl:when> |
| 77 |
<xsl:when test="$level = 4"> |
| 78 |
<xsl:element name="fo:{$section.container.element}" |
| 79 |
use-attribute-sets="section.level4.properties"> |
| 80 |
<xsl:attribute name="id"><xsl:value-of |
| 81 |
select="$id"/></xsl:attribute> |
| 82 |
<xsl:call-template name="section.content"/> |
| 83 |
</xsl:element> |
| 84 |
</xsl:when> |
| 85 |
<xsl:when test="$level = 5"> |
| 86 |
<xsl:element name="fo:{$section.container.element}" |
| 87 |
use-attribute-sets="section.level5.properties"> |
| 88 |
<xsl:attribute name="id"><xsl:value-of |
| 89 |
select="$id"/></xsl:attribute> |
| 90 |
<xsl:call-template name="section.content"/> |
| 91 |
</xsl:element> |
| 92 |
</xsl:when> |
| 93 |
<xsl:otherwise> |
| 94 |
<xsl:element name="fo:{$section.container.element}" |
| 95 |
use-attribute-sets="section.level6.properties"> |
| 96 |
<xsl:attribute name="id"><xsl:value-of |
| 97 |
select="$id"/></xsl:attribute> |
| 98 |
<xsl:call-template name="section.content"/> |
| 99 |
</xsl:element> |
| 100 |
</xsl:otherwise> |
| 101 |
</xsl:choose> |
| 102 |
</xsl:otherwise> |
| 103 |
</xsl:choose> |
| 104 |
</xsl:template> |
| 105 |
|
| 106 |
<xsl:template name="section.content"> |
| 107 |
<xsl:call-template name="section.titlepage"/> |
| 108 |
|
| 109 |
<xsl:variable name="toc.params"> |
| 110 |
<xsl:call-template name="find.path.params"> |
| 111 |
<xsl:with-param name="table" select="normalize-space($generate.toc)"/> |
| 112 |
</xsl:call-template> |
| 113 |
</xsl:variable> |
| 114 |
|
| 115 |
<xsl:if test="contains($toc.params, 'toc') |
| 116 |
and (count(ancestor::d:section)+1) <= |
| 117 |
$generate.section.toc.level"> |
| 118 |
<xsl:call-template name="section.toc"> |
| 119 |
<xsl:with-param name="toc.title.p" |
| 120 |
select="contains($toc.params, 'title')"/> |
| 121 |
</xsl:call-template> |
| 122 |
<xsl:call-template name="section.toc.separator"/> |
| 123 |
</xsl:if> |
| 124 |
|
| 125 |
<xsl:apply-templates/> |
| 126 |
</xsl:template> |
| 127 |
|
| 128 |
<xsl:template match="/d:section" name="section.page.sequence"> |
| 129 |
<xsl:variable name="id"> |
| 130 |
<xsl:call-template name="object.id"/> |
| 131 |
</xsl:variable> |
| 132 |
|
| 133 |
<xsl:variable name="master-reference"> |
| 134 |
<xsl:call-template name="select.pagemaster"/> |
| 135 |
</xsl:variable> |
| 136 |
|
| 137 |
<fo:page-sequence hyphenate="{$hyphenate}" |
| 138 |
master-reference="{$master-reference}"> |
| 139 |
<xsl:attribute name="language"> |
| 140 |
<xsl:call-template name="l10n.language"/> |
| 141 |
</xsl:attribute> |
| 142 |
<xsl:attribute name="format"> |
| 143 |
<xsl:call-template name="page.number.format"> |
| 144 |
<xsl:with-param name="master-reference" select="$master-reference"/> |
| 145 |
</xsl:call-template> |
| 146 |
</xsl:attribute> |
| 147 |
|
| 148 |
<xsl:attribute name="initial-page-number"> |
| 149 |
<xsl:call-template name="initial.page.number"> |
| 150 |
<xsl:with-param name="master-reference" select="$master-reference"/> |
| 151 |
</xsl:call-template> |
| 152 |
</xsl:attribute> |
| 153 |
|
| 154 |
<xsl:attribute name="force-page-count"> |
| 155 |
<xsl:call-template name="force.page.count"> |
| 156 |
<xsl:with-param name="master-reference" select="$master-reference"/> |
| 157 |
</xsl:call-template> |
| 158 |
</xsl:attribute> |
| 159 |
|
| 160 |
<xsl:attribute name="hyphenation-character"> |
| 161 |
<xsl:call-template name="gentext"> |
| 162 |
<xsl:with-param name="key" select="'hyphenation-character'"/> |
| 163 |
</xsl:call-template> |
| 164 |
</xsl:attribute> |
| 165 |
<xsl:attribute name="hyphenation-push-character-count"> |
| 166 |
<xsl:call-template name="gentext"> |
| 167 |
<xsl:with-param name="key" select="'hyphenation-push-character-count'"/> |
| 168 |
</xsl:call-template> |
| 169 |
</xsl:attribute> |
| 170 |
<xsl:attribute name="hyphenation-remain-character-count"> |
| 171 |
<xsl:call-template name="gentext"> |
| 172 |
<xsl:with-param name="key" select="'hyphenation-remain-character-count'"/> |
| 173 |
</xsl:call-template> |
| 174 |
</xsl:attribute> |
| 175 |
|
| 176 |
<xsl:apply-templates select="." mode="running.head.mode"> |
| 177 |
<xsl:with-param name="master-reference" select="$master-reference"/> |
| 178 |
</xsl:apply-templates> |
| 179 |
<xsl:apply-templates select="." mode="running.foot.mode"> |
| 180 |
<xsl:with-param name="master-reference" select="$master-reference"/> |
| 181 |
</xsl:apply-templates> |
| 182 |
|
| 183 |
<fo:flow flow-name="xsl-region-body"> |
| 184 |
<xsl:call-template name="set.flow.properties"> |
| 185 |
<xsl:with-param name="element" select="local-name(.)"/> |
| 186 |
<xsl:with-param name="master-reference" select="$master-reference"/> |
| 187 |
</xsl:call-template> |
| 188 |
|
| 189 |
<fo:block id="{$id}" |
| 190 |
xsl:use-attribute-sets="section.level1.properties"> |
| 191 |
<xsl:call-template name="section.titlepage"/> |
| 192 |
</fo:block> |
| 193 |
|
| 194 |
<xsl:variable name="toc.params"> |
| 195 |
<xsl:call-template name="find.path.params"> |
| 196 |
<xsl:with-param name="table" select="normalize-space($generate.toc)"/> |
| 197 |
</xsl:call-template> |
| 198 |
</xsl:variable> |
| 199 |
|
| 200 |
<xsl:if test="contains($toc.params, 'toc') |
| 201 |
and (count(ancestor::d:section)+1) <= |
| 202 |
$generate.section.toc.level"> |
| 203 |
<xsl:call-template name="section.toc"> |
| 204 |
<xsl:with-param name="toc.title.p" |
| 205 |
select="contains($toc.params, 'title')"/> |
| 206 |
</xsl:call-template> |
| 207 |
<xsl:call-template name="section.toc.separator"/> |
| 208 |
</xsl:if> |
| 209 |
|
| 210 |
<xsl:apply-templates/> |
| 211 |
</fo:flow> |
| 212 |
</fo:page-sequence> |
| 213 |
</xsl:template> |
| 214 |
|
| 215 |
<xsl:template match="d:section/d:title |
| 216 |
|d:simplesect/d:title |
| 217 |
|d:sect1/d:title |
| 218 |
|d:sect2/d:title |
| 219 |
|d:sect3/d:title |
| 220 |
|d:sect4/d:title |
| 221 |
|d:sect5/d:title |
| 222 |
|d:section/d:info/d:title |
| 223 |
|d:simplesect/d:info/d:title |
| 224 |
|d:sect1/d:info/d:title |
| 225 |
|d:sect2/d:info/d:title |
| 226 |
|d:sect3/d:info/d:title |
| 227 |
|d:sect4/d:info/d:title |
| 228 |
|d:sect5/d:info/d:title |
| 229 |
|d:section/d:sectioninfo/d:title |
| 230 |
|d:sect1/d:sect1info/d:title |
| 231 |
|d:sect2/d:sect2info/d:title |
| 232 |
|d:sect3/d:sect3info/d:title |
| 233 |
|d:sect4/d:sect4info/d:title |
| 234 |
|d:sect5/d:sect5info/d:title" |
| 235 |
mode="titlepage.mode" |
| 236 |
priority="2"> |
| 237 |
|
| 238 |
<xsl:variable name="section" |
| 239 |
select="(ancestor::d:section | |
| 240 |
ancestor::d:simplesect | |
| 241 |
ancestor::d:sect1 | |
| 242 |
ancestor::d:sect2 | |
| 243 |
ancestor::d:sect3 | |
| 244 |
ancestor::d:sect4 | |
| 245 |
ancestor::d:sect5)[position() = last()]"/> |
| 246 |
|
| 247 |
<fo:block keep-with-next.within-column="always"> |
| 248 |
<xsl:variable name="id"> |
| 249 |
<xsl:call-template name="object.id"> |
| 250 |
<xsl:with-param name="object" select="$section"/> |
| 251 |
</xsl:call-template> |
| 252 |
</xsl:variable> |
| 253 |
|
| 254 |
<xsl:variable name="renderas"> |
| 255 |
<xsl:choose> |
| 256 |
<xsl:when test="$section/@renderas = 'sect1'">1</xsl:when> |
| 257 |
<xsl:when test="$section/@renderas = 'sect2'">2</xsl:when> |
| 258 |
<xsl:when test="$section/@renderas = 'sect3'">3</xsl:when> |
| 259 |
<xsl:when test="$section/@renderas = 'sect4'">4</xsl:when> |
| 260 |
<xsl:when test="$section/@renderas = 'sect5'">5</xsl:when> |
| 261 |
<xsl:otherwise><xsl:value-of select="''"/></xsl:otherwise> |
| 262 |
</xsl:choose> |
| 263 |
</xsl:variable> |
| 264 |
|
| 265 |
<xsl:variable name="level"> |
| 266 |
<xsl:choose> |
| 267 |
<xsl:when test="$renderas != ''"> |
| 268 |
<xsl:value-of select="$renderas"/> |
| 269 |
</xsl:when> |
| 270 |
<xsl:otherwise> |
| 271 |
<xsl:call-template name="section.level"> |
| 272 |
<xsl:with-param name="node" select="$section"/> |
| 273 |
</xsl:call-template> |
| 274 |
</xsl:otherwise> |
| 275 |
</xsl:choose> |
| 276 |
</xsl:variable> |
| 277 |
|
| 278 |
<xsl:variable name="marker"> |
| 279 |
<xsl:choose> |
| 280 |
<xsl:when test="$level <= $marker.section.level">1</xsl:when> |
| 281 |
<xsl:otherwise>0</xsl:otherwise> |
| 282 |
</xsl:choose> |
| 283 |
</xsl:variable> |
| 284 |
|
| 285 |
<xsl:variable name="title"> |
| 286 |
<xsl:apply-templates select="$section" mode="object.title.markup"> |
| 287 |
<xsl:with-param name="allow-anchors" select="1"/> |
| 288 |
</xsl:apply-templates> |
| 289 |
</xsl:variable> |
| 290 |
|
| 291 |
<xsl:variable name="marker.title"> |
| 292 |
<xsl:apply-templates select="$section" mode="titleabbrev.markup"> |
| 293 |
<xsl:with-param name="allow-anchors" select="0"/> |
| 294 |
</xsl:apply-templates> |
| 295 |
</xsl:variable> |
| 296 |
|
| 297 |
<xsl:if test="$axf.extensions != 0 and |
| 298 |
$xsl1.1.bookmarks = 0 and |
| 299 |
$show.bookmarks != 0"> |
| 300 |
<xsl:attribute name="axf:outline-level"> |
| 301 |
<xsl:value-of select="count(ancestor::*)-1"/> |
| 302 |
</xsl:attribute> |
| 303 |
<xsl:attribute name="axf:outline-expand">false</xsl:attribute> |
| 304 |
<xsl:attribute name="axf:outline-title"> |
| 305 |
<xsl:value-of select="normalize-space($title)"/> |
| 306 |
</xsl:attribute> |
| 307 |
</xsl:if> |
| 308 |
|
| 309 |
<xsl:call-template name="section.heading"> |
| 310 |
<xsl:with-param name="level" select="$level"/> |
| 311 |
<xsl:with-param name="title" select="$title"/> |
| 312 |
<xsl:with-param name="marker" select="$marker"/> |
| 313 |
<xsl:with-param name="marker.title" select="$marker.title"/> |
| 314 |
</xsl:call-template> |
| 315 |
</fo:block> |
| 316 |
</xsl:template> |
| 317 |
|
| 318 |
<xsl:template match="d:sect1"> |
| 319 |
<xsl:variable name="id"> |
| 320 |
<xsl:call-template name="object.id"/> |
| 321 |
</xsl:variable> |
| 322 |
|
| 323 |
<xsl:element name="fo:{$section.container.element}" |
| 324 |
use-attribute-sets="section.level1.properties"> |
| 325 |
<xsl:attribute name="id"><xsl:value-of |
| 326 |
select="$id"/></xsl:attribute> |
| 327 |
<xsl:call-template name="sect1.titlepage"/> |
| 328 |
|
| 329 |
<xsl:variable name="toc.params"> |
| 330 |
<xsl:call-template name="find.path.params"> |
| 331 |
<xsl:with-param name="table" select="normalize-space($generate.toc)"/> |
| 332 |
</xsl:call-template> |
| 333 |
</xsl:variable> |
| 334 |
|
| 335 |
<xsl:if test="contains($toc.params, 'toc') |
| 336 |
and $generate.section.toc.level >= 1"> |
| 337 |
<xsl:call-template name="section.toc"> |
| 338 |
<xsl:with-param name="toc.title.p" |
| 339 |
select="contains($toc.params, 'title')"/> |
| 340 |
</xsl:call-template> |
| 341 |
<xsl:call-template name="section.toc.separator"/> |
| 342 |
</xsl:if> |
| 343 |
|
| 344 |
<xsl:apply-templates/> |
| 345 |
</xsl:element> |
| 346 |
</xsl:template> |
| 347 |
|
| 348 |
<xsl:template match="/d:sect1"> |
| 349 |
<xsl:variable name="id"> |
| 350 |
<xsl:call-template name="object.id"/> |
| 351 |
</xsl:variable> |
| 352 |
<xsl:variable name="master-reference"> |
| 353 |
<xsl:call-template name="select.pagemaster"/> |
| 354 |
</xsl:variable> |
| 355 |
|
| 356 |
<fo:page-sequence hyphenate="{$hyphenate}" |
| 357 |
master-reference="{$master-reference}"> |
| 358 |
<xsl:attribute name="language"> |
| 359 |
<xsl:call-template name="l10n.language"/> |
| 360 |
</xsl:attribute> |
| 361 |
<xsl:attribute name="format"> |
| 362 |
<xsl:call-template name="page.number.format"> |
| 363 |
<xsl:with-param name="master-reference" select="$master-reference"/> |
| 364 |
</xsl:call-template> |
| 365 |
</xsl:attribute> |
| 366 |
|
| 367 |
<xsl:attribute name="initial-page-number"> |
| 368 |
<xsl:call-template name="initial.page.number"> |
| 369 |
<xsl:with-param name="master-reference" select="$master-reference"/> |
| 370 |
</xsl:call-template> |
| 371 |
</xsl:attribute> |
| 372 |
|
| 373 |
<xsl:attribute name="force-page-count"> |
| 374 |
<xsl:call-template name="force.page.count"> |
| 375 |
<xsl:with-param name="master-reference" select="$master-reference"/> |
| 376 |
</xsl:call-template> |
| 377 |
</xsl:attribute> |
| 378 |
|
| 379 |
<xsl:attribute name="hyphenation-character"> |
| 380 |
<xsl:call-template name="gentext"> |
| 381 |
<xsl:with-param name="key" select="'hyphenation-character'"/> |
| 382 |
</xsl:call-template> |
| 383 |
</xsl:attribute> |
| 384 |
<xsl:attribute name="hyphenation-push-character-count"> |
| 385 |
<xsl:call-template name="gentext"> |
| 386 |
<xsl:with-param name="key" select="'hyphenation-push-character-count'"/> |
| 387 |
</xsl:call-template> |
| 388 |
</xsl:attribute> |
| 389 |
<xsl:attribute name="hyphenation-remain-character-count"> |
| 390 |
<xsl:call-template name="gentext"> |
| 391 |
<xsl:with-param name="key" select="'hyphenation-remain-character-count'"/> |
| 392 |
</xsl:call-template> |
| 393 |
</xsl:attribute> |
| 394 |
|
| 395 |
<xsl:apply-templates select="." mode="running.head.mode"> |
| 396 |
<xsl:with-param name="master-reference" select="$master-reference"/> |
| 397 |
</xsl:apply-templates> |
| 398 |
<xsl:apply-templates select="." mode="running.foot.mode"> |
| 399 |
<xsl:with-param name="master-reference" select="$master-reference"/> |
| 400 |
</xsl:apply-templates> |
| 401 |
|
| 402 |
<fo:flow flow-name="xsl-region-body"> |
| 403 |
<xsl:call-template name="set.flow.properties"> |
| 404 |
<xsl:with-param name="element" select="local-name(.)"/> |
| 405 |
<xsl:with-param name="master-reference" select="$master-reference"/> |
| 406 |
</xsl:call-template> |
| 407 |
|
| 408 |
<fo:block id="{$id}" |
| 409 |
xsl:use-attribute-sets="section.level1.properties"> |
| 410 |
<xsl:call-template name="sect1.titlepage"/> |
| 411 |
</fo:block> |
| 412 |
|
| 413 |
<xsl:variable name="toc.params"> |
| 414 |
<xsl:call-template name="find.path.params"> |
| 415 |
<xsl:with-param name="table" select="normalize-space($generate.toc)"/> |
| 416 |
</xsl:call-template> |
| 417 |
</xsl:variable> |
| 418 |
|
| 419 |
<xsl:if test="contains($toc.params, 'toc') |
| 420 |
and $generate.section.toc.level >= 1"> |
| 421 |
<xsl:call-template name="section.toc"> |
| 422 |
<xsl:with-param name="toc.title.p" |
| 423 |
select="contains($toc.params, 'title')"/> |
| 424 |
</xsl:call-template> |
| 425 |
<xsl:call-template name="section.toc.separator"/> |
| 426 |
</xsl:if> |
| 427 |
|
| 428 |
<xsl:apply-templates/> |
| 429 |
</fo:flow> |
| 430 |
</fo:page-sequence> |
| 431 |
</xsl:template> |
| 432 |
|
| 433 |
<xsl:template match="d:sect2"> |
| 434 |
<xsl:variable name="id"> |
| 435 |
<xsl:call-template name="object.id"/> |
| 436 |
</xsl:variable> |
| 437 |
|
| 438 |
<xsl:element name="fo:{$section.container.element}" |
| 439 |
use-attribute-sets="section.level2.properties"> |
| 440 |
<xsl:attribute name="id"><xsl:value-of |
| 441 |
select="$id"/></xsl:attribute> |
| 442 |
<xsl:call-template name="sect2.titlepage"/> |
| 443 |
|
| 444 |
<xsl:variable name="toc.params"> |
| 445 |
<xsl:call-template name="find.path.params"> |
| 446 |
<xsl:with-param name="table" select="normalize-space($generate.toc)"/> |
| 447 |
</xsl:call-template> |
| 448 |
</xsl:variable> |
| 449 |
|
| 450 |
<xsl:if test="contains($toc.params, 'toc') |
| 451 |
and $generate.section.toc.level >= 2"> |
| 452 |
<xsl:call-template name="section.toc"> |
| 453 |
<xsl:with-param name="toc.title.p" |
| 454 |
select="contains($toc.params, 'title')"/> |
| 455 |
</xsl:call-template> |
| 456 |
<xsl:call-template name="section.toc.separator"/> |
| 457 |
</xsl:if> |
| 458 |
|
| 459 |
<xsl:apply-templates/> |
| 460 |
</xsl:element> |
| 461 |
</xsl:template> |
| 462 |
|
| 463 |
<xsl:template match="d:sect3"> |
| 464 |
<xsl:variable name="id"> |
| 465 |
<xsl:call-template name="object.id"/> |
| 466 |
</xsl:variable> |
| 467 |
|
| 468 |
<xsl:element name="fo:{$section.container.element}" |
| 469 |
use-attribute-sets="section.level3.properties"> |
| 470 |
<xsl:attribute name="id"><xsl:value-of |
| 471 |
select="$id"/></xsl:attribute> |
| 472 |
<xsl:call-template name="sect3.titlepage"/> |
| 473 |
|
| 474 |
<xsl:variable name="toc.params"> |
| 475 |
<xsl:call-template name="find.path.params"> |
| 476 |
<xsl:with-param name="table" select="normalize-space($generate.toc)"/> |
| 477 |
</xsl:call-template> |
| 478 |
</xsl:variable> |
| 479 |
|
| 480 |
<xsl:if test="contains($toc.params, 'toc') |
| 481 |
and $generate.section.toc.level >= 3"> |
| 482 |
<xsl:call-template name="section.toc"> |
| 483 |
<xsl:with-param name="toc.title.p" |
| 484 |
select="contains($toc.params, 'title')"/> |
| 485 |
</xsl:call-template> |
| 486 |
<xsl:call-template name="section.toc.separator"/> |
| 487 |
</xsl:if> |
| 488 |
|
| 489 |
<xsl:apply-templates/> |
| 490 |
</xsl:element> |
| 491 |
</xsl:template> |
| 492 |
|
| 493 |
<xsl:template match="d:sect4"> |
| 494 |
<xsl:variable name="id"> |
| 495 |
<xsl:call-template name="object.id"/> |
| 496 |
</xsl:variable> |
| 497 |
|
| 498 |
<xsl:element name="fo:{$section.container.element}" |
| 499 |
use-attribute-sets="section.level4.properties"> |
| 500 |
<xsl:attribute name="id"><xsl:value-of |
| 501 |
select="$id"/></xsl:attribute> |
| 502 |
<xsl:call-template name="sect4.titlepage"/> |
| 503 |
|
| 504 |
<xsl:variable name="toc.params"> |
| 505 |
<xsl:call-template name="find.path.params"> |
| 506 |
<xsl:with-param name="table" select="normalize-space($generate.toc)"/> |
| 507 |
</xsl:call-template> |
| 508 |
</xsl:variable> |
| 509 |
|
| 510 |
<xsl:if test="contains($toc.params, 'toc') |
| 511 |
and $generate.section.toc.level >= 4"> |
| 512 |
<xsl:call-template name="section.toc"> |
| 513 |
<xsl:with-param name="toc.title.p" |
| 514 |
select="contains($toc.params, 'title')"/> |
| 515 |
</xsl:call-template> |
| 516 |
<xsl:call-template name="section.toc.separator"/> |
| 517 |
</xsl:if> |
| 518 |
|
| 519 |
<xsl:apply-templates/> |
| 520 |
</xsl:element> |
| 521 |
</xsl:template> |
| 522 |
|
| 523 |
<xsl:template match="d:sect5"> |
| 524 |
<xsl:variable name="id"> |
| 525 |
<xsl:call-template name="object.id"/> |
| 526 |
</xsl:variable> |
| 527 |
|
| 528 |
<xsl:element name="fo:{$section.container.element}" |
| 529 |
use-attribute-sets="section.level5.properties"> |
| 530 |
<xsl:attribute name="id"><xsl:value-of |
| 531 |
select="$id"/></xsl:attribute> |
| 532 |
<xsl:call-template name="sect5.titlepage"/> |
| 533 |
|
| 534 |
<xsl:variable name="toc.params"> |
| 535 |
<xsl:call-template name="find.path.params"> |
| 536 |
<xsl:with-param name="table" select="normalize-space($generate.toc)"/> |
| 537 |
</xsl:call-template> |
| 538 |
</xsl:variable> |
| 539 |
|
| 540 |
<xsl:if test="contains($toc.params, 'toc') |
| 541 |
and $generate.section.toc.level >= 5"> |
| 542 |
<xsl:call-template name="section.toc"> |
| 543 |
<xsl:with-param name="toc.title.p" |
| 544 |
select="contains($toc.params, 'title')"/> |
| 545 |
</xsl:call-template> |
| 546 |
<xsl:call-template name="section.toc.separator"/> |
| 547 |
</xsl:if> |
| 548 |
|
| 549 |
<xsl:apply-templates/> |
| 550 |
</xsl:element> |
| 551 |
</xsl:template> |
| 552 |
|
| 553 |
<xsl:template match="d:simplesect"> |
| 554 |
<xsl:variable name="id"> |
| 555 |
<xsl:call-template name="object.id"/> |
| 556 |
</xsl:variable> |
| 557 |
|
| 558 |
<xsl:element name="fo:{$section.container.element}"> |
| 559 |
<xsl:attribute name="id"><xsl:value-of |
| 560 |
select="$id"/></xsl:attribute> |
| 561 |
<xsl:call-template name="simplesect.titlepage"/> |
| 562 |
<xsl:apply-templates/> |
| 563 |
</xsl:element> |
| 564 |
</xsl:template> |
| 565 |
|
| 566 |
<xsl:template match="d:sectioninfo"></xsl:template> |
| 567 |
<xsl:template match="d:section/d:info"></xsl:template> |
| 568 |
<xsl:template match="d:section/d:title"></xsl:template> |
| 569 |
<xsl:template match="d:section/d:titleabbrev"></xsl:template> |
| 570 |
<xsl:template match="d:section/d:subtitle"></xsl:template> |
| 571 |
|
| 572 |
<xsl:template match="d:sect1info"></xsl:template> |
| 573 |
<xsl:template match="d:sect1/d:info"></xsl:template> |
| 574 |
<xsl:template match="d:sect1/d:title"></xsl:template> |
| 575 |
<xsl:template match="d:sect1/d:titleabbrev"></xsl:template> |
| 576 |
<xsl:template match="d:sect1/d:subtitle"></xsl:template> |
| 577 |
|
| 578 |
<xsl:template match="d:sect2info"></xsl:template> |
| 579 |
<xsl:template match="d:sect2/d:info"></xsl:template> |
| 580 |
<xsl:template match="d:sect2/d:title"></xsl:template> |
| 581 |
<xsl:template match="d:sect2/d:titleabbrev"></xsl:template> |
| 582 |
<xsl:template match="d:sect2/d:subtitle"></xsl:template> |
| 583 |
|
| 584 |
<xsl:template match="d:sect3info"></xsl:template> |
| 585 |
<xsl:template match="d:sect3/d:info"></xsl:template> |
| 586 |
<xsl:template match="d:sect3/d:title"></xsl:template> |
| 587 |
<xsl:template match="d:sect3/d:titleabbrev"></xsl:template> |
| 588 |
<xsl:template match="d:sect3/d:subtitle"></xsl:template> |
| 589 |
|
| 590 |
<xsl:template match="d:sect4info"></xsl:template> |
| 591 |
<xsl:template match="d:sect4/d:info"></xsl:template> |
| 592 |
<xsl:template match="d:sect4/d:title"></xsl:template> |
| 593 |
<xsl:template match="d:sect4/d:titleabbrev"></xsl:template> |
| 594 |
<xsl:template match="d:sect4/d:subtitle"></xsl:template> |
| 595 |
|
| 596 |
<xsl:template match="d:sect5info"></xsl:template> |
| 597 |
<xsl:template match="d:sect5/d:info"></xsl:template> |
| 598 |
<xsl:template match="d:sect5/d:title"></xsl:template> |
| 599 |
<xsl:template match="d:sect5/d:titleabbrev"></xsl:template> |
| 600 |
<xsl:template match="d:sect5/d:subtitle"></xsl:template> |
| 601 |
|
| 602 |
<xsl:template match="d:simplesect/d:info"></xsl:template> |
| 603 |
<xsl:template match="d:simplesect/d:title"></xsl:template> |
| 604 |
<xsl:template match="d:simplesect/d:titleabbrev"></xsl:template> |
| 605 |
<xsl:template match="d:simplesect/d:subtitle"></xsl:template> |
| 606 |
|
| 607 |
|
| 608 |
|
| 609 |
<xsl:template name="section.heading"> |
| 610 |
<xsl:param name="level" select="1"/> |
| 611 |
<xsl:param name="marker" select="1"/> |
| 612 |
<xsl:param name="title"/> |
| 613 |
<xsl:param name="marker.title"/> |
| 614 |
|
| 615 |
<fo:block xsl:use-attribute-sets="section.title.properties"> |
| 616 |
<xsl:if test="$marker != 0"> |
| 617 |
<fo:marker marker-class-name="section.head.marker"> |
| 618 |
<xsl:copy-of select="$marker.title"/> |
| 619 |
</fo:marker> |
| 620 |
</xsl:if> |
| 621 |
|
| 622 |
<xsl:choose> |
| 623 |
<xsl:when test="$level=1"> |
| 624 |
<fo:block xsl:use-attribute-sets="section.title.level1.properties"> |
| 625 |
<xsl:copy-of select="$title"/> |
| 626 |
</fo:block> |
| 627 |
</xsl:when> |
| 628 |
<xsl:when test="$level=2"> |
| 629 |
<fo:block xsl:use-attribute-sets="section.title.level2.properties"> |
| 630 |
<xsl:copy-of select="$title"/> |
| 631 |
</fo:block> |
| 632 |
</xsl:when> |
| 633 |
<xsl:when test="$level=3"> |
| 634 |
<fo:block xsl:use-attribute-sets="section.title.level3.properties"> |
| 635 |
<xsl:copy-of select="$title"/> |
| 636 |
</fo:block> |
| 637 |
</xsl:when> |
| 638 |
<xsl:when test="$level=4"> |
| 639 |
<fo:block xsl:use-attribute-sets="section.title.level4.properties"> |
| 640 |
<xsl:copy-of select="$title"/> |
| 641 |
</fo:block> |
| 642 |
</xsl:when> |
| 643 |
<xsl:when test="$level=5"> |
| 644 |
<fo:block xsl:use-attribute-sets="section.title.level5.properties"> |
| 645 |
<xsl:copy-of select="$title"/> |
| 646 |
</fo:block> |
| 647 |
</xsl:when> |
| 648 |
<xsl:otherwise> |
| 649 |
<fo:block xsl:use-attribute-sets="section.title.level6.properties"> |
| 650 |
<xsl:copy-of select="$title"/> |
| 651 |
</fo:block> |
| 652 |
</xsl:otherwise> |
| 653 |
</xsl:choose> |
| 654 |
</fo:block> |
| 655 |
</xsl:template> |
| 656 |
|
| 657 |
|
| 658 |
|
| 659 |
<xsl:template match="d:bridgehead"> |
| 660 |
<xsl:variable name="container" |
| 661 |
select="(ancestor::d:appendix |
| 662 |
|ancestor::d:article |
| 663 |
|ancestor::d:bibliography |
| 664 |
|ancestor::d:chapter |
| 665 |
|ancestor::d:glossary |
| 666 |
|ancestor::d:glossdiv |
| 667 |
|ancestor::d:index |
| 668 |
|ancestor::d:partintro |
| 669 |
|ancestor::d:preface |
| 670 |
|ancestor::d:refsect1 |
| 671 |
|ancestor::d:refsect2 |
| 672 |
|ancestor::d:refsect3 |
| 673 |
|ancestor::d:sect1 |
| 674 |
|ancestor::d:sect2 |
| 675 |
|ancestor::d:sect3 |
| 676 |
|ancestor::d:sect4 |
| 677 |
|ancestor::d:sect5 |
| 678 |
|ancestor::d:section |
| 679 |
|ancestor::d:setindex |
| 680 |
|ancestor::d:simplesect)[last()]"/> |
| 681 |
|
| 682 |
<xsl:variable name="clevel"> |
| 683 |
<xsl:choose> |
| 684 |
<xsl:when test="local-name($container) = 'appendix' |
| 685 |
or local-name($container) = 'chapter' |
| 686 |
or local-name($container) = 'article' |
| 687 |
or local-name($container) = 'bibliography' |
| 688 |
or local-name($container) = 'glossary' |
| 689 |
or local-name($container) = 'index' |
| 690 |
or local-name($container) = 'partintro' |
| 691 |
or local-name($container) = 'preface' |
| 692 |
or local-name($container) = 'setindex'">2</xsl:when> |
| 693 |
<xsl:when test="local-name($container) = 'glossdiv'"> |
| 694 |
<xsl:value-of select="count(ancestor::d:glossdiv)+2"/> |
| 695 |
</xsl:when> |
| 696 |
<xsl:when test="local-name($container) = 'sect1' |
| 697 |
or local-name($container) = 'sect2' |
| 698 |
or local-name($container) = 'sect3' |
| 699 |
or local-name($container) = 'sect4' |
| 700 |
or local-name($container) = 'sect5' |
| 701 |
or local-name($container) = 'refsect1' |
| 702 |
or local-name($container) = 'refsect2' |
| 703 |
or local-name($container) = 'refsect3' |
| 704 |
or local-name($container) = 'section' |
| 705 |
or local-name($container) = 'simplesect'"> |
| 706 |
<xsl:variable name="slevel"> |
| 707 |
<xsl:call-template name="section.level"> |
| 708 |
<xsl:with-param name="node" select="$container"/> |
| 709 |
</xsl:call-template> |
| 710 |
</xsl:variable> |
| 711 |
<xsl:value-of select="$slevel + 1"/> |
| 712 |
</xsl:when> |
| 713 |
<xsl:otherwise>2</xsl:otherwise> |
| 714 |
</xsl:choose> |
| 715 |
</xsl:variable> |
| 716 |
|
| 717 |
<xsl:variable name="level"> |
| 718 |
<xsl:choose> |
| 719 |
<xsl:when test="@renderas = 'sect1'">1</xsl:when> |
| 720 |
<xsl:when test="@renderas = 'sect2'">2</xsl:when> |
| 721 |
<xsl:when test="@renderas = 'sect3'">3</xsl:when> |
| 722 |
<xsl:when test="@renderas = 'sect4'">4</xsl:when> |
| 723 |
<xsl:when test="@renderas = 'sect5'">5</xsl:when> |
| 724 |
<xsl:otherwise> |
| 725 |
<xsl:value-of select="$clevel"/> |
| 726 |
</xsl:otherwise> |
| 727 |
</xsl:choose> |
| 728 |
</xsl:variable> |
| 729 |
|
| 730 |
<xsl:variable name="marker"> |
| 731 |
<xsl:choose> |
| 732 |
<xsl:when test="$level <= $marker.section.level">1</xsl:when> |
| 733 |
<xsl:otherwise>0</xsl:otherwise> |
| 734 |
</xsl:choose> |
| 735 |
</xsl:variable> |
| 736 |
|
| 737 |
<xsl:variable name="marker.title"> |
| 738 |
<xsl:apply-templates/> |
| 739 |
</xsl:variable> |
| 740 |
|
| 741 |
<xsl:variable name="id"> |
| 742 |
<xsl:call-template name="object.id"/> |
| 743 |
</xsl:variable> |
| 744 |
|
| 745 |
<fo:block id="{$id}"> |
| 746 |
<xsl:call-template name="section.heading"> |
| 747 |
<xsl:with-param name="level" select="$level"/> |
| 748 |
<xsl:with-param name="title"> |
| 749 |
<xsl:apply-templates/> |
| 750 |
</xsl:with-param> |
| 751 |
<xsl:with-param name="marker" select="$marker"/> |
| 752 |
<xsl:with-param name="marker.title" select="$marker.title"/> |
| 753 |
</xsl:call-template> |
| 754 |
</fo:block> |
| 755 |
</xsl:template> |
| 756 |
|
| 757 |
</xsl:stylesheet> |
| 758 |
|