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