Showing:

Documentation
Parameters
Used by
References
Supersedes
Included from
Source
Stylesheet textstructure.xsl
Documentation

Description

TEI stylesheet dealing with elements from the textstructure module, making XSL-FO output.

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

Author: See AUTHORS

Id: $Id: textstructure.xsl 7865 2010-07-20 13:25:16Z rahtz $

Copyright: 2008, TEI Consortium

Included from
Stylesheet version 2.0
Template *innertext
Documentation

Description

Process elements * in inner mode
Namespace No namespace
Match *
Mode innertext
Import precedence 3
Source
<xsl:template match="*" mode="innertext">
  <xsl:apply-templates select="."/>
</xsl:template>
Stylesheet location ../../../fo2/textstructure.xsl
Template tei:*heading
Documentation

Description

Namespace No namespace
Match tei:*
Mode heading
Import precedence 3
Source
<xsl:template match="tei:*" mode="heading">
  <xsl:apply-templates/>
</xsl:template>
Stylesheet location ../../../fo2/textstructure.xsl
Template tei:TEI
Documentation

Description

Namespace No namespace
Match tei:TEI
Mode #default
References
Import precedence 3
Source
<xsl:template match="tei:TEI">
  <root>
    <xsl:call-template name="setupPagemasters"/>
    <xsl:call-template name="mainAction"/>
  </root>
</xsl:template>
Stylesheet location ../../../fo2/textstructure.xsl
Template tei:back
Documentation

Description

Namespace No namespace
Match tei:back
Mode #default
References
Import precedence 3
Source
<xsl:template match="tei:back">
  <xsl:comment>Back matter</xsl:comment>
  <xsl:choose>
    <xsl:when test="ancestor::tei:group">
      <xsl:apply-templates/>
    </xsl:when>
    <xsl:otherwise>
      <page-sequence format="{$formatBackpage}" text-align="{$alignment}" hyphenate="{$hyphenate}" language="{$language}">
        <xsl:call-template name="choosePageMaster">
          <xsl:with-param name="where">
            <xsl:value-of select="$backMulticolumns"/>
          </xsl:with-param>
        </xsl:call-template>
        <!-- static areas -->
        <xsl:choose>
          <xsl:when test="$twoSided='true'">
            <xsl:call-template name="headers-footers-twoside-back"/>
          </xsl:when>
          <xsl:otherwise>
            <xsl:call-template name="headers-footers-oneside-back"/>
          </xsl:otherwise>
        </xsl:choose>
        <!-- now start the main flow -->
        <flow flow-name="xsl-region-body" font-family="{$bodyFont}" font-size="{$bodySize}">
          <xsl:apply-templates/>
          <xsl:call-template name="afterBodyHook"/>
        </flow>
      </page-sequence>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location ../../../fo2/textstructure.xsl
Template tei:body
Documentation

Description

Namespace No namespace
Match tei:body
Mode #default
References
Import precedence 3
Source
<xsl:template match="tei:body">
  <xsl:choose>
    <xsl:when test="ancestor::tei:floatingText">
      <xsl:apply-templates/>
    </xsl:when>
    <xsl:when test="ancestor::tei:p">
      <xsl:apply-templates/>
    </xsl:when>
    <xsl:when test="ancestor::tei:group">
      <xsl:apply-templates/>
    </xsl:when>
    <xsl:otherwise>
      <!-- start page sequence -->
      <page-sequence format="{$formatBodypage}" text-align="{$alignment}" hyphenate="{$hyphenate}" language="{$language}" initial-page-number="1">
        <xsl:call-template name="choosePageMaster">
          <xsl:with-param name="where">
            <xsl:value-of select="$bodyMulticolumns"/>
          </xsl:with-param>
        </xsl:call-template>
        <!-- static areas -->
        <xsl:choose>
          <xsl:when test="$twoSided='true'">
            <xsl:call-template name="headers-footers-twoside"/>
          </xsl:when>
          <xsl:otherwise>
            <xsl:call-template name="headers-footers-oneside"/>
          </xsl:otherwise>
        </xsl:choose>
        <!-- now start the main  flow -->
        <flow flow-name="xsl-region-body" font-family="{$bodyFont}" font-size="{$bodySize}">
          <xsl:if test="not($flowMarginLeft='')">
            <xsl:attribute name="margin-left">
              <xsl:value-of select="$flowMarginLeft"/>
            </xsl:attribute>
          </xsl:if>
          <!--include front matter if there is no separate titlepage -->
          <xsl:if test="not($titlePage='true') and not(preceding-sibling::tei:front)">
            <xsl:call-template name="Header"/>
          </xsl:if>
          <xsl:apply-templates/>
          <xsl:if test=".//tei:note[@place='end']">
            <block>
              <xsl:call-template name="setupDiv2"/>
              <xsl:text>Notes</xsl:text>
            </block>
            <xsl:apply-templates select=".//tei:note[@place='end']" mode="endnote"/>
          </xsl:if>
        </flow>
      </page-sequence>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location ../../../fo2/textstructure.xsl
Template tei:closer
Documentation

Description

Namespace No namespace
Match tei:closer
Mode #default
References
Parameter exampleMargin
Import precedence 3
Source
<xsl:template match="tei:closer">
  <block space-before.optimum="4pt" space-after.optimum="4pt" end-indent="{$exampleMargin}" start-indent="{$exampleMargin}">
    <xsl:apply-templates/>
  </block>
</xsl:template>
Stylesheet location ../../../fo2/textstructure.xsl
Template tei:dateline
Documentation

Description

Namespace No namespace
Match tei:dateline
Mode #default
Import precedence 3
Source
<xsl:template match="tei:dateline">
  <block text-align="end">
    <xsl:apply-templates/>
  </block>
</xsl:template>
Stylesheet location ../../../fo2/textstructure.xsl
Template tei:div
Documentation

Description

Normal headings
Namespace No namespace
Match tei:div
Mode #default
References
Import precedence 3
Source
<xsl:template match="tei:div">
  <xsl:text>
</xsl:text>
  <xsl:choose>
    <xsl:when test="@type='bibliog'">
      <xsl:apply-templates/>
    </xsl:when>
    <xsl:when test="@type='abstract'">
      <block keep-with-next.within-page="always" end-indent="{$exampleMargin}" start-indent="{$exampleMargin}">
        <xsl:attribute name="text-align">center</xsl:attribute>
        <xsl:call-template name="setupDiv2"/>
        <inline font-style="italic">Abstract</inline>
      </block>
      <xsl:apply-templates/>
    </xsl:when>
    <xsl:when test="@type='ack'">
      <block keep-with-next.within-page="always">
        <xsl:attribute name="text-align">start</xsl:attribute>
        <xsl:call-template name="setupDiv3"/>
        <inline font-style="italic">Acknowledgements</inline>
      </block>
      <xsl:apply-templates/>
    </xsl:when>
    <xsl:otherwise>
      <!-- behaviour depends on the nesting level of <div> elements -->
      <xsl:variable name="divlevel" select="count(ancestor::tei:div)"/>
      <xsl:call-template name="NumberedHeading">
        <xsl:with-param name="level">
          <xsl:value-of select="$divlevel"/>
        </xsl:with-param>
      </xsl:call-template>
      <xsl:apply-templates/>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location ../../../fo2/textstructure.xsl
Template tei:divtoc
Documentation

Description

headings in TOC
Namespace No namespace
Match tei:div
Mode toc
References
Template tocheading
Import precedence 3
Source
<xsl:template match="tei:div" mode="toc">
  <xsl:variable name="divlevel">
    <xsl:value-of select="count(ancestor::tei:div)"/>
  </xsl:variable>
  <xsl:call-template name="tocheading">
    <xsl:with-param name="level">
      <xsl:value-of select="$divlevel"/>
    </xsl:with-param>
  </xsl:call-template>
</xsl:template>
Stylesheet location ../../../fo2/textstructure.xsl
Template tei:divxref
Documentation

Description

Namespace No namespace
Match tei:div
Mode xref
References
Template xheading
Import precedence 3
Source
<xsl:template match="tei:div" mode="xref">
  <xsl:variable name="divlevel" select="count(ancestor::tei:div)"/>
  <xsl:call-template name="xheading">
    <xsl:with-param name="level">div
      <xsl:value-of select="$divlevel"/>
    </xsl:with-param>
  </xsl:call-template>
</xsl:template>
Stylesheet location ../../../fo2/textstructure.xsl
Template tei:div1|tei:div2|tei:div3|tei:div4|tei:div5
Documentation

Description

Namespace No namespace
Match tei:div1|tei:div2|tei:div3|tei:div4|tei:div5
Mode #default
References
Template NumberedHeading
Import precedence 3
Source
<xsl:template match="tei:div1|tei:div2|tei:div3|tei:div4|tei:div5">
  <xsl:choose>
    <xsl:when test="@type='letter'">
      <xsl:apply-templates/>
    </xsl:when>
    <xsl:otherwise>
      <xsl:call-template name="NumberedHeading">
        <xsl:with-param name="level">
          <xsl:value-of select="substring-after(local-name(),'div')"/>
        </xsl:with-param>
      </xsl:call-template>
      <xsl:apply-templates/>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location ../../../fo2/textstructure.xsl
Template tei:div1|tei:div2|tei:div3|tei:div4|tei:div5toc
Documentation

Description

Process elements tei:div1|tei:div2|tei:div3|tei:div4|tei:div5 (toc mode)
Namespace No namespace
Match tei:div1|tei:div2|tei:div3|tei:div4|tei:div5
Mode toc
References
Template tocheading
Import precedence 3
Source
<xsl:template match="tei:div1|tei:div2|tei:div3|tei:div4|tei:div5" mode="toc">
  <xsl:call-template name="tocheading">
    <xsl:with-param name="level">
      <xsl:value-of select="substring-after(local-name(),'div')"/>
    </xsl:with-param>
  </xsl:call-template>
</xsl:template>
Stylesheet location ../../../fo2/textstructure.xsl
Template tei:div1|tei:div2|tei:div3|tei:div4|tei:div5xref
Documentation

Description

Namespace No namespace
Match tei:div1|tei:div2|tei:div3|tei:div4|tei:div5
Mode xref
References
Template xheading
Import precedence 3
Source
<xsl:template mode="xref" match="tei:div1|tei:div2|tei:div3|tei:div4|tei:div5">
  <xsl:call-template name="xheading">
    <xsl:with-param name="level">
      <xsl:value-of select="local-name()"/>
    </xsl:with-param>
  </xsl:call-template>
</xsl:template>
Stylesheet location ../../../fo2/textstructure.xsl
Template tei:div[@type='canto']
Documentation

Description

Namespace No namespace
Match tei:div[@type='canto']
Mode #default
References
Template NumberedHeading
Import precedence 3
Source
<xsl:template match="tei:div[@type='canto']">
  <xsl:variable name="divlevel" select="count(ancestor::tei:div)"/>
  <xsl:call-template name="NumberedHeading">
    <xsl:with-param name="level">
      <xsl:value-of select="$divlevel"/>
    </xsl:with-param>
  </xsl:call-template>
  <xsl:apply-templates/>
</xsl:template>
Stylesheet location ../../../fo2/textstructure.xsl
Template tei:div[@type='frontispiece']
Documentation

Description

Frontispiece
Namespace No namespace
Match tei:div[@type='frontispiece']
Mode #default
Import precedence 3
Source
<xsl:template match="tei:div[@type='frontispiece']">
  <xsl:apply-templates/>
</xsl:template>
Stylesheet location ../../../fo2/textstructure.xsl
Template tei:div[@type='illustration']
Documentation

Description

Namespace No namespace
Match tei:div[@type='illustration']
Mode #default
Import precedence 3
Source
<xsl:template match="tei:div[@type='illustration']">
  <xsl:apply-templates/>
</xsl:template>
Stylesheet location ../../../fo2/textstructure.xsl
Template tei:divGen
Documentation

Description

Table of contents
Namespace No namespace
Match tei:divGen
Mode #default
References
Templates bookTOC; mainTOC
Import precedence 3
Source
<xsl:template match="tei:divGen">
  <xsl:choose>
    <xsl:when test="@type='toc' and ancestor::tei:text/tei:group">
      <xsl:call-template name="bookTOC"/>
    </xsl:when>
    <xsl:when test="@type='toc'">
      <xsl:call-template name="mainTOC"/>
    </xsl:when>
  </xsl:choose>
</xsl:template>
Stylesheet location ../../../fo2/textstructure.xsl
Template tei:front
Documentation

Description

Namespace No namespace
Match tei:front
Mode #default
References
Import precedence 3
Source
<xsl:template match="tei:front">
  <xsl:comment>Front matter</xsl:comment>
  <xsl:choose>
    <xsl:when test="ancestor::tei:floatingText">
      <xsl:apply-templates/>
    </xsl:when>
    <xsl:when test="ancestor::tei:p">
      <xsl:apply-templates/>
    </xsl:when>
    <xsl:when test="ancestor::tei:group">
      <xsl:apply-templates/>
    </xsl:when>
    <xsl:otherwise>
      <xsl:if test="$titlePage='true'">
        <page-sequence format="{$formatFrontpage}" force-page-count="end-on-even" hyphenate="{$hyphenate}" language="{$language}">
          <xsl:call-template name="choosePageMaster">
            <xsl:with-param name="where">
              <xsl:value-of select="$frontMulticolumns"/>
            </xsl:with-param>
          </xsl:call-template>
          <static-content flow-name="xsl-region-before">
            <block/>
          </static-content>
          <static-content flow-name="xsl-region-after">
            <block/>
          </static-content>
          <flow flow-name="xsl-region-body" font-family="{$bodyFont}">
            <xsl:call-template name="Header"/>
          </flow>
        </page-sequence>
      </xsl:if>
      <page-sequence format="{$formatFrontpage}" text-align="{$alignment}" hyphenate="{$hyphenate}" language="{$language}" initial-page-number="1">
        <xsl:call-template name="choosePageMaster">
          <xsl:with-param name="where">
            <xsl:value-of select="$frontMulticolumns"/>
          </xsl:with-param>
        </xsl:call-template>
        <!-- static areas -->
        <xsl:choose>
          <xsl:when test="$twoSided='true'">
            <xsl:call-template name="headers-footers-twoside"/>
          </xsl:when>
          <xsl:otherwise>
            <xsl:call-template name="headers-footers-oneside"/>
          </xsl:otherwise>
        </xsl:choose>
        <!-- now start the main flow -->
        <flow flow-name="xsl-region-body" font-family="{$bodyFont}" font-size="{$bodySize}">
          <xsl:for-each select="tei:*">
            <xsl:comment>Start <xsl:value-of select="name(.)"/>
            </xsl:comment>
            <xsl:apply-templates select="."/>
            <xsl:comment>End <xsl:value-of select="name(.)"/>
            </xsl:comment>
          </xsl:for-each>
        </flow>
      </page-sequence>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location ../../../fo2/textstructure.xsl
Template tei:group/tei:text
Documentation

Description

Namespace No namespace
Match tei:group/tei:text
Mode #default
References
Import precedence 3
Source
<xsl:template match="tei:group/tei:text">
  <xsl:variable name="N">
    <xsl:number/>
  </xsl:variable>
  <page-sequence format="1" text-align="{$alignment}" hyphenate="{$hyphenate}" language="{$language}" master-reference="twoside1">
    <xsl:attribute name="initial-page-number">
      <xsl:choose>
        <xsl:when test="$N = 1">1</xsl:when>
        <xsl:otherwise>auto-odd</xsl:otherwise>
      </xsl:choose>
    </xsl:attribute>
    <xsl:call-template name="grouptextStatic"/>
    <flow flow-name="xsl-region-body" font-family="{$bodyFont}">
      <xsl:call-template name="textTitle">
        <xsl:with-param name="N" select="$N"/>
      </xsl:call-template>
      <xsl:apply-templates select="tei:body"/>
      <xsl:apply-templates select="tei:back"/>
    </flow>
  </page-sequence>
</xsl:template>
Stylesheet location ../../../fo2/textstructure.xsl
Template tei:group/tei:text/tei:body
Documentation

Description

Namespace No namespace
Match tei:group/tei:text/tei:body
Mode #default
References
Template setupDiv2
Import precedence 3
Source
<xsl:template match="tei:group/tei:text/tei:body">
  <xsl:apply-templates/>
  <xsl:if test=".//tei:note[@place='end']">
    <block>
      <xsl:call-template name="setupDiv2"/>
      <xsl:text>Notes</xsl:text>
    </block>
    <xsl:apply-templates select=".//tei:note[@place='end']" mode="endnote"/>
  </xsl:if>
</xsl:template>
Stylesheet location ../../../fo2/textstructure.xsl
Template tei:headsection
Documentation

Description

Simple head
Namespace No namespace
Match tei:head
Mode section
Import precedence 3
Source
<xsl:template match="tei:head" mode="section">
  <!-- if we have multiple <head> elements together, 
  separate by spaces -->
  <!--
   <xsl:if test="preceding-sibling::tei:head">
	<xsl:text> </xsl:text>
     </xsl:if>
-->
  <xsl:apply-templates/>
</xsl:template>
Stylesheet location ../../../fo2/textstructure.xsl
Template tei:headmakeheading
Documentation

Description

Process element head in heading mode
Namespace No namespace
Match tei:head
Mode makeheading
Import precedence 3
Source
<xsl:template match="tei:head" mode="makeheading">
  <xsl:apply-templates/>
</xsl:template>
Stylesheet location ../../../fo2/textstructure.xsl
Template tei:head
Documentation

Description

unqualified <head>
Namespace No namespace
Match tei:head
Mode #default
Import precedence 3
Source
<xsl:template match="tei:head"/>
Stylesheet location ../../../fo2/textstructure.xsl
Template tei:opener
Documentation

Description

Namespace No namespace
Match tei:opener
Mode #default
References
Parameter exampleMargin
Import precedence 3
Source
<xsl:template match="tei:opener">
  <block space-before.optimum="4pt" space-after.optimum="4pt" end-indent="{$exampleMargin}" start-indent="{$exampleMargin}">
    <xsl:apply-templates/>
  </block>
</xsl:template>
Stylesheet location ../../../fo2/textstructure.xsl
Template tei:textxref
Documentation

Description

headings when cross-referenced
Namespace No namespace
Match tei:text
Mode xref
Supersedes
Template tei:textxref
Import precedence 3
Source
<xsl:template match="tei:text" mode="xref">
  <xsl:choose>
    <xsl:when test="@n">
      <xsl:value-of select="@n"/>
    </xsl:when>
    <xsl:otherwise>
      <xsl:number/>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location ../../../fo2/textstructure.xsl
Template tei:text
Documentation

Description

Namespace No namespace
Match tei:text
Mode #default
References
Import precedence 3
Source
<xsl:template match="tei:text">
  <xsl:choose>
    <xsl:when test="parent::tei:TEI">
      <xsl:apply-templates/>
    </xsl:when>
    <xsl:when test="parent::tei:group">
      <xsl:apply-templates/>
    </xsl:when>
    <xsl:otherwise>
      <block text-align="start" text-indent="0pt" end-indent="{$exampleMargin}" start-indent="{$exampleMargin}" font-size="{$exampleSize}" border-top-style="solid" border-bottom-style="solid" space-before.optimum="{$exampleBefore}" space-after.optimum="{$exampleAfter}">
        <xsl:apply-templates mode="innertext"/>
      </block>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location ../../../fo2/textstructure.xsl
Template tei:texttoc
Documentation

Description

Namespace No namespace
Match tei:text
Mode toc
References
Template linkStyle
Import precedence 3
Source
<xsl:template match="tei:text" mode="toc">
  <block>
    <xsl:attribute name="font-weight">bold</xsl:attribute>
    <xsl:number/>
    <xsl:text></xsl:text>
    <inline>
      <xsl:choose>
        <xsl:when test="tei:front/tei:docTitle[@n]">
          <xsl:value-of select="tei:front/tei:docTitle/@n"/>
        </xsl:when>
        <xsl:otherwise>
          <xsl:value-of select="tei:front/tei:docTitle"/>
        </xsl:otherwise>
      </xsl:choose>
    </inline>
    <leader rule-thickness="0pt"/>
    <inline>
      <xsl:call-template name="linkStyle"/>
      <xsl:variable name="pagref">
        <xsl:choose>
          <xsl:when test="@xml:id">
            <xsl:value-of select="@xml:id"/>
          </xsl:when>
          <xsl:otherwise>
            <xsl:value-of select="generate-id()"/>
          </xsl:otherwise>
        </xsl:choose>
      </xsl:variable>
      <basic-link internal-destination="{$pagref}">
        <page-number-citation ref-id="{$pagref}"/>
      </basic-link>
    </inline>
  </block>
  <block font-style="italic" space-after="10pt" space-before="6pt">
    <xsl:apply-templates select="tei:front//tei:docAuthor" mode="heading"/>
  </block>
</xsl:template>
Stylesheet location ../../../fo2/textstructure.xsl
Template tei:titlePage
Documentation

Description

Namespace No namespace
Match tei:titlePage
Mode #default
Import precedence 3
Source
<xsl:template match="tei:titlePage">
  <block text-align="center">
    <xsl:apply-templates/>
  </block>
</xsl:template>
Stylesheet location ../../../fo2/textstructure.xsl
Template tei:titlePage//tei:titlePart[@type='main']
Documentation

Description

Namespace No namespace
Match tei:titlePage//tei:titlePart[@type='main']
Mode #default
References
Parameter titleSize
Import precedence 3
Source
<xsl:template match="tei:titlePage//tei:titlePart[@type='main']">
  <block font-size="{$titleSize}" space-after="8pt" text-align="center">
    <xsl:apply-templates/>
  </block>
</xsl:template>
Stylesheet location ../../../fo2/textstructure.xsl
Template tei:titlePage//tei:titlePart[@type='sub']
Documentation

Description

Namespace No namespace
Match tei:titlePage//tei:titlePart[@type='sub']
Mode #default
References
Parameter authorSize
Import precedence 3
Source
<xsl:template match="tei:titlePage//tei:titlePart[@type='sub']">
  <block>
    <block font-size="{$authorSize}" space-after="8pt" text-align="center">
      <xsl:apply-templates/>
    </block>
  </block>
</xsl:template>
Stylesheet location ../../../fo2/textstructure.xsl
Template tei:titlePart
Documentation

Description

Namespace No namespace
Match tei:titlePart
Mode #default
Supersedes
Template tei:titlePart
Import precedence 3
Source
<xsl:template match="tei:titlePart">
  <xsl:apply-templates/>
</xsl:template>
Stylesheet location ../../../fo2/textstructure.xsl
Template tei:titlePart[@type='running']
Documentation

Description

Namespace No namespace
Match tei:titlePart[@type='running']
Mode #default
Import precedence 3
Source
<xsl:template match="tei:titlePart[@type='running']"/>
Stylesheet location ../../../fo2/textstructure.xsl
Template tei:trailer
Documentation

Description

Namespace No namespace
Match tei:trailer
Mode #default
Import precedence 3
Source
<xsl:template match="tei:trailer">
  <block>
    <xsl:apply-templates/>
  </block>
</xsl:template>
Stylesheet location ../../../fo2/textstructure.xsl
Template Header
Documentation

Description

Process elements text()

Description

[fo]
Namespace No namespace
Used by
Templates tei:body; tei:front
References
Import precedence 3
Source
<xsl:template name="Header">
  <block font-size="12pt" padding-before="6pt">
    <inline>
      <xsl:value-of select="$institution"/>
    </inline>
  </block>
  <block font-size="12pt" font-weight="bold">
    <xsl:call-template name="generateTitle"/>
  </block>
  <block>
    <xsl:call-template name="generateAuthor"/>
  </block>
  <block padding-after="6pt">
    <xsl:call-template name="generateDate"/>
  </block>
</xsl:template>
Stylesheet location ../../../fo2/textstructure.xsl
Template NumberedHeading
Documentation

Description

[fo]

Parameters

level level

Namespace No namespace
Used by
References
Parameters
QName Namespace
level No namespace
Import precedence 3
Source
<xsl:template name="NumberedHeading">
  <xsl:param name="level"/>
  <block keep-with-next.within-page="always">
    <xsl:variable name="divid">
      <xsl:choose>
        <xsl:when test="@xml:id">
          <xsl:value-of select="@xml:id"/>
        </xsl:when>
        <xsl:otherwise>
          <xsl:value-of select="generate-id()"/>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:variable>
    <xsl:attribute name="id">
      <xsl:value-of select="$divid"/>
    </xsl:attribute>
    <xsl:attribute name="text-align">start</xsl:attribute>
    <xsl:attribute name="font-family">
      <xsl:value-of select="$divFont"/>
    </xsl:attribute>
    <xsl:choose>
      <xsl:when test="$level=0">
        <xsl:call-template name="setupDiv0"/>
      </xsl:when>
      <xsl:when test="$level=1">
        <xsl:call-template name="setupDiv1"/>
      </xsl:when>
      <xsl:when test="$level=2">
        <xsl:call-template name="setupDiv2"/>
      </xsl:when>
      <xsl:when test="$level=3">
        <xsl:call-template name="setupDiv3"/>
      </xsl:when>
      <xsl:when test="$level=4">
        <xsl:call-template name="setupDiv4"/>
      </xsl:when>
      <xsl:when test="$level=5">
        <xsl:call-template name="setupDiv5"/>
      </xsl:when>
      <xsl:when test="$level=6">
        <xsl:call-template name="setupDiv6"/>
      </xsl:when>
    </xsl:choose>
    <xsl:call-template name="blockStartHook"/>
    <xsl:variable name="Number">
      <xsl:if test="$numberHeadings='true' and $numberHeadingsDepth > $level">
        <xsl:call-template name="calculateNumber">
          <xsl:with-param name="numbersuffix">
            <xsl:call-template name="headingNumberSuffix"/>
          </xsl:with-param>
        </xsl:call-template>
      </xsl:if>
    </xsl:variable>
    <!--
<xsl:message>**  Calculated   [<xsl:value-of select="$Number"/>] [<xsl:value-of select="$headingNumberSuffix"/>] for <xsl:value-of select="@xml:id"/></xsl:message>
-->
    <xsl:value-of select="$Number"/>
    <xsl:apply-templates mode="section" select="tei:head"/>
    <xsl:if test="$divRunningheads='true'">
      <!-- markers for use in running heads -->
      <xsl:choose>
        <xsl:when test="$level=0">
          <marker marker-class-name="section1"/>
          <marker marker-class-name="section2"/>
          <marker marker-class-name="section3"/>
          <marker marker-class-name="section4"/>
          <marker marker-class-name="section5"/>
        </xsl:when>
        <xsl:when test="$level=1">
          <marker marker-class-name="section2"/>
          <marker marker-class-name="section3"/>
          <marker marker-class-name="section4"/>
          <marker marker-class-name="section5"/>
        </xsl:when>
        <xsl:when test="$level=2">
          <marker marker-class-name="section3"/>
          <marker marker-class-name="section4"/>
          <marker marker-class-name="section5"/>
        </xsl:when>
        <xsl:when test="$level=3">
          <marker marker-class-name="section4"/>
          <marker marker-class-name="section5"/>
        </xsl:when>
        <xsl:when test="$level=4">
          <marker marker-class-name="section5"/>
        </xsl:when>
        <xsl:when test="$level=5"/>
      </xsl:choose>
      <marker marker-class-name="section{$level}">
        <xsl:if test="$numberHeadings='true'">
          <xsl:value-of select="$Number"/>
          <xsl:call-template name="headingNumberSuffix"/>
        </xsl:if>
        <xsl:value-of select="tei:head"/>
      </marker>
    </xsl:if>
    <xsl:choose>
      <xsl:when test="$foEngine='passivetex'">
        <!-- Passive TeX extension, to get PDF bookmarks -->
        <fotex:bookmark fotex-bookmark-level="{$level}" fotex-bookmark-label="{$divid}">
          <xsl:if test="$numberHeadings='true'">
            <xsl:value-of select="$Number"/>
          </xsl:if>
          <xsl:value-of select="tei:head"/>
        </fotex:bookmark>
      </xsl:when>
    </xsl:choose>
  </block>
</xsl:template>
Stylesheet location ../../../fo2/textstructure.xsl
Template bookTOC
Documentation

Description

[fo]
Namespace No namespace
Used by
Template tei:divGen
References
Import precedence 3
Source
<xsl:template name="bookTOC">
  <page-sequence format="1" initial-page-number="{$tocStartPage}" master-reference="twoside1">
    <xsl:call-template name="headers-footers-twoside">
      <xsl:with-param name="runeven">even page running head</xsl:with-param>
      <xsl:with-param name="runodd"> odd page running head</xsl:with-param>
    </xsl:call-template>
    <flow flow-name="xsl-region-body" font-family="{$bodyFont}">
      <block text-align="center">
        <xsl:attribute name="font-size">
          <xsl:value-of select="$tocSize"/>
        </xsl:attribute>
        <xsl:attribute name="text-indent">
          <xsl:value-of select="$headingOutdent"/>
        </xsl:attribute>
        <xsl:attribute name="font-weight">bold</xsl:attribute>
        <xsl:attribute name="space-after">24pt</xsl:attribute>
        <xsl:attribute name="space-before.optimum">24pt</xsl:attribute>
        <xsl:text>Contents</xsl:text>
      </block>
      <xsl:for-each select="ancestor::tei:text/tei:group/tei:text">
        <xsl:apply-templates select="." mode="toc"/>
      </xsl:for-each>
    </flow>
  </page-sequence>
</xsl:template>
Stylesheet location ../../../fo2/textstructure.xsl
Template choosePageMaster
Documentation

Description

[fo]

Parameters

where where

force force

Namespace No namespace
Used by
References
Parameters
QName Namespace
force No namespace
where No namespace
Import precedence 3
Source
<xsl:template name="choosePageMaster">
  <xsl:param name="where"/>
  <xsl:param name="force"/>
  <xsl:variable name="mn">
    <xsl:choose>
      <xsl:when test="$forcePageMaster">
        <xsl:value-of select="$forcePageMaster"/>
      </xsl:when>
      <xsl:when test="not($where='')">
        <xsl:choose>
          <xsl:when test="$twoSided='true'">twoside2</xsl:when>
          <xsl:otherwise>oneside2</xsl:otherwise>
        </xsl:choose>
      </xsl:when>
      <xsl:otherwise>
        <xsl:choose>
          <xsl:when test="$twoSided='true'">twoside1</xsl:when>
          <xsl:otherwise>oneside1</xsl:otherwise>
        </xsl:choose>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:variable>
  <xsl:attribute name="master-reference">
    <xsl:value-of select="$mn"/>
  </xsl:attribute>
</xsl:template>
Stylesheet location ../../../fo2/textstructure.xsl
Template grouptextStatic
Documentation

Description

[fo]
Namespace No namespace
Used by
References
Parameters bodySize; runFont; runSize
Import precedence 3
Source
<xsl:template name="grouptextStatic">
  <static-content flow-name="xsl-region-after-right">
    <block text-align="end" font-size="{$bodySize}">
      <page-number/>
    </block>
  </static-content>
  <static-content flow-name="xsl-region-after-left">
    <block text-align="start" font-size="{$bodySize}">
      <page-number/>
    </block>
  </static-content>
  <static-content flow-name="xsl-region-before-left">
    <block text-indent="0em" background-color="blue" font-weight="bold" padding="3pt" color="white" font-family="{$runFont}" text-align="justify" font-size="{$runSize}">
      <inline>
        <xsl:number/>
      </inline>
      <leader rule-thickness="0pt"/>
      <inline>
        <xsl:choose>
          <xsl:when test="front/tei:docTitle[@n]">
            <xsl:value-of select="tei:front/tei:docTitle[@n]"/>
          </xsl:when>
          <xsl:otherwise>
            <xsl:value-of select="tei:front/tei:docTitle"/>
          </xsl:otherwise>
        </xsl:choose>
      </inline>
    </block>
  </static-content>
  <static-content flow-name="xsl-region-before-right">
    <block background-color="blue" text-indent="0em" font-weight="bold" padding="3pt" color="white" text-align="left" font-family="{$runFont}" font-size="{$runSize}">
      <xsl:value-of select="tei:front//tei:docAuthor"/>
    </block>
  </static-content>
</xsl:template>
Stylesheet location ../../../fo2/textstructure.xsl
Template headers-footers-oneside
Documentation

Description

[fo]

Parameters

runhead runhead

Namespace No namespace
Used by
References
Parameter bodySize
Template runninghead-author
Parameters
QName Namespace
runhead No namespace
Import precedence 3
Source
<xsl:template name="headers-footers-oneside">
  <xsl:param name="runhead"/>
  <static-content flow-name="xsl-region-before">
    <block font-size="{$bodySize}">
      <xsl:choose>
        <xsl:when test="$runhead='true'">
          <xsl:value-of select="$runhead"/>
        </xsl:when>
        <xsl:otherwise>
          <xsl:call-template name="runninghead-author"/>
        </xsl:otherwise>
      </xsl:choose>
    </block>
  </static-content>
  <static-content flow-name="xsl-region-after">
    <block text-align="center" font-size="{$bodySize}">
      <page-number/>
    </block>
  </static-content>
  <static-content flow-name="xsl-region-before-first">
  </static-content>
  <static-content flow-name="xsl-region-after-first">
    <block text-align="center" font-size="{$bodySize}">
      <page-number/>
    </block>
  </static-content>
</xsl:template>
Stylesheet location ../../../fo2/textstructure.xsl
Template headers-footers-oneside-back
Documentation

Description

[fo]

Parameters

runhead runhead

Namespace No namespace
Used by
Template tei:back
References
Parameters
QName Namespace
runhead No namespace
Import precedence 3
Source
<xsl:template name="headers-footers-oneside-back">
  <xsl:param name="runhead"/>
  <xsl:call-template name="headers-footers-oneside">
    <xsl:with-param name="runhead">
      <xsl:value-of select="$runhead"/>
    </xsl:with-param>
  </xsl:call-template>
</xsl:template>
Stylesheet location ../../../fo2/textstructure.xsl
Template headers-footers-twoside
Documentation

Description

[fo]

Parameters

runodd odd page running head

runeven even page running head

Namespace No namespace
Used by
References
Parameters
QName Namespace
runeven No namespace
runodd No namespace
Import precedence 3
Source
<xsl:template name="headers-footers-twoside">
  <xsl:param name="runodd"/>
  <xsl:param name="runeven"/>
  <static-content flow-name="xsl-region-before-right">
    <block text-align="justify" text-align-last="justify" font-size="{$bodySize}">
      <xsl:choose>
        <xsl:when test="$runodd">
          <xsl:value-of select="$runodd"/>
        </xsl:when>
        <xsl:when test="$sectionHeaders='true'">
          <block>
            <xsl:if test="$divRunningheads='true'">
              <inline>
                <retrieve-marker retrieve-class-name="section2"/>
              </inline>
            </xsl:if>
            <leader rule-thickness="0pt"/>
            <inline>
              <page-number/>
            </inline>
          </block>
        </xsl:when>
        <xsl:otherwise>
          <xsl:call-template name="runninghead-title"/>
        </xsl:otherwise>
      </xsl:choose>
    </block>
  </static-content>
  <static-content flow-name="xsl-region-before-left">
    <block text-align="justify" font-size="{$bodySize}">
      <xsl:choose>
        <xsl:when test="$runeven">
          <xsl:value-of select="$runeven"/>
        </xsl:when>
        <xsl:when test="$sectionHeaders='true'">
          <block>
            <inline>
              <page-number/>
            </inline>
            <leader rule-thickness="0pt"/>
            <xsl:if test="$divRunningheads='true'">
              <inline>
                <retrieve-marker retrieve-class-name="section1"/>
              </inline>
            </xsl:if>
          </block>
        </xsl:when>
        <xsl:otherwise>
          <xsl:call-template name="runninghead-author"/>
        </xsl:otherwise>
      </xsl:choose>
    </block>
  </static-content>
  <static-content flow-name="xsl-region-before-first">
    <block/>
  </static-content>
  <static-content flow-name="xsl-region-after-right">
    <block text-align="end" font-size="{$bodySize}">
      <page-number/>
    </block>
  </static-content>
  <static-content flow-name="xsl-region-after-left">
    <block text-align="start" font-size="{$bodySize}">
      <page-number/>
    </block>
  </static-content>
  <static-content flow-name="xsl-region-after-first">
    <block font-size="{$bodySize}" text-align="end">
      <page-number/>
    </block>
  </static-content>
</xsl:template>
Stylesheet location ../../../fo2/textstructure.xsl
Template headers-footers-twoside-back
Documentation

Description

[fo]

Parameters

runodd odd page running head

runeven even page running head

Namespace No namespace
Used by
Template tei:back
References
Parameters
QName Namespace
runeven No namespace
runodd No namespace
Import precedence 3
Source
<xsl:template name="headers-footers-twoside-back">
  <xsl:param name="runodd"/>
  <xsl:param name="runeven"/>
  <xsl:call-template name="headers-footers-twoside">
    <xsl:with-param name="runeven">
      <xsl:value-of select="$runeven"/>
    </xsl:with-param>
    <xsl:with-param name="runodd">
      <xsl:value-of select="$runodd"/>
    </xsl:with-param>
  </xsl:call-template>
</xsl:template>
Stylesheet location ../../../fo2/textstructure.xsl
Template mainAction
Documentation

Description

[fo]
Namespace No namespace
Used by
Template tei:TEI
Import precedence 3
Source
<xsl:template name="mainAction">
  <xsl:choose>
    <xsl:when test="tei:text/tei:group">
      <xsl:apply-templates select="tei:text/tei:front"/>
      <xsl:apply-templates select="tei:text/tei:group"/>
    </xsl:when>
    <xsl:otherwise>
      <xsl:apply-templates select="tei:text/tei:front"/>
      <xsl:apply-templates select="tei:text/tei:body"/>
    </xsl:otherwise>
  </xsl:choose>
  <xsl:apply-templates select="tei:text/tei:back"/>
</xsl:template>
Stylesheet location ../../../fo2/textstructure.xsl
Template mainTOC
Documentation

Description

[fo]
Namespace No namespace
Used by
Template tei:divGen
References
Templates i18n; setupDiv1; tocBits
Parameters tocBack; tocFront
Import precedence 3
Source
<xsl:template name="mainTOC">
  <block>
    <xsl:call-template name="setupDiv1"/>
    <xsl:call-template name="i18n">
      <xsl:with-param name="word">contentsWord</xsl:with-param>
    </xsl:call-template>
  </block>
  <xsl:choose>
    <xsl:when test="ancestor::tei:text/tei:group">
      <xsl:for-each select="ancestor::tei:text/tei:group">
        <xsl:apply-templates select="tei:text" mode="toc"/>
      </xsl:for-each>
    </xsl:when>
    <xsl:when test="ancestor::tei:text/tei:body/tei:div1">
      <xsl:if test="$tocFront='true'">
        <xsl:for-each select="ancestor::tei:text/tei:front/tei:div1|ancestor::tei:text/tei:front//tei:div2|ancestor::tei:text/tei:front//tei:div3">
          <xsl:apply-templates mode="toc" select="(.)"/>
        </xsl:for-each>
      </xsl:if>
      <xsl:for-each select="ancestor::tei:text/tei:body/tei:div1|ancestor::tei:text/tei:body//tei:div2|ancestor::tei:text/tei:body//tei:div3">
        <xsl:apply-templates mode="toc" select="(.)"/>
      </xsl:for-each>
      <xsl:if test="$tocBack='true'">
        <xsl:for-each select="ancestor::tei:text/tei:back/tei:div1|ancestor::tei:text/tei:back//tei:div2|ancestor::tei:text/tei:back//tei:div3">
          <xsl:apply-templates mode="toc" select="(.)"/>
        </xsl:for-each>
      </xsl:if>
    </xsl:when>
    <xsl:otherwise>
      <xsl:call-template name="tocBits"/>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location ../../../fo2/textstructure.xsl
Template runninghead-author
Documentation

Description

[fo]
Namespace No namespace
Used by
Import precedence 3
Source
<xsl:template name="runninghead-author">
  <xsl:choose>
    <xsl:when test="ancestor::tei:text[1]/tei:front//tei:docAuthor[@type='running']">
      <xsl:apply-templates select="ancestor-or-self::tei:text[1]/tei:front//tei:docAuthor[@type='running']" mode="heading"/>
    </xsl:when>
    <xsl:otherwise>
      <xsl:apply-templates select="ancestor-or-self::tei:text[1]/tei:front//tei:docAuthor" mode="heading"/>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location ../../../fo2/textstructure.xsl
Template runninghead-title
Documentation

Description

[fo]
Namespace No namespace
Used by
Import precedence 3
Source
<xsl:template name="runninghead-title">
  <xsl:comment>Running Head: title</xsl:comment>
  <xsl:choose>
    <xsl:when test="ancestor-or-self::tei:text[1]/tei:front//tei:docTitle[1]/tei:titlePart[@type='running']">
      <xsl:apply-templates select="ancestor-or-self::tei:text[1]/tei:front//tei:docTitle[1]/tei:titlePart[@type='running']" mode="heading"/>
    </xsl:when>
    <xsl:otherwise>
      <xsl:apply-templates select="ancestor-or-self::tei:text[1]/tei:front//tei:docTitle[1]/tei:titlePart" mode="heading"/>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location ../../../fo2/textstructure.xsl
Template setupPagemasters
Documentation

Description

[fo]
Namespace No namespace
Used by
Template tei:TEI
References
Import precedence 3
Source
<xsl:template name="setupPagemasters">
  <layout-master-set>
    <!-- one sided, single column -->
    <simple-page-master master-name="simple1" page-width="{$pageWidth}" page-height="{$pageHeight}" margin-top="{$pageMarginTop}" margin-bottom="{$pageMarginBottom}" margin-left="{$pageMarginLeft}" margin-right="{$pageMarginRight}">
      <region-body margin-bottom="{$bodyMarginBottom}" margin-top="{$bodyMarginTop}"/>
      <region-before extent="{$regionBeforeExtent}"/>
      <region-after extent="{$regionAfterExtent}"/>
    </simple-page-master>
    <!-- for left-hand/tei:even pages in twosided mode, single column -->
    <simple-page-master master-name="left1" page-width="{$pageWidth}" page-height="{$pageHeight}" margin-top="{$pageMarginTop}" margin-bottom="{$pageMarginBottom}" margin-left="{$pageMarginLeft}" margin-right="{$pageMarginRight}">
      <region-body margin-bottom="{$bodyMarginBottom}" margin-top="{$bodyMarginTop}"/>
      <region-before region-name="xsl-region-before-left" extent="{$regionBeforeExtent}"/>
      <region-after region-name="xsl-region-after-left" extent="{$regionAfterExtent}"/>
    </simple-page-master>
    <!-- for right-hand/tei:odd pages in twosided mode, single column -->
    <simple-page-master master-name="right1" page-width="{$pageWidth}" page-height="{$pageHeight}" margin-top="{$pageMarginTop}" margin-bottom="{$pageMarginBottom}" margin-left="{$pageMarginLeft}" margin-right="{$pageMarginRight}">
      <region-body margin-bottom="{$bodyMarginBottom}" margin-top="{$bodyMarginTop}"/>
      <region-before region-name="xsl-region-before-right" extent="{$regionBeforeExtent}"/>
      <region-after region-name="xsl-region-after-right" extent="{$regionAfterExtent}"/>
    </simple-page-master>
    <!-- special case of first page in either mode, single column -->
    <simple-page-master master-name="first1" page-width="{$pageWidth}" page-height="{$pageHeight}" margin-top="{$pageMarginTop}" margin-bottom="{$pageMarginBottom}" margin-left="{$pageMarginLeft}" margin-right="{$pageMarginRight}">
      <region-body margin-bottom="{$bodyMarginBottom}" margin-top="{$bodyMarginTop}"/>
      <region-before region-name="xsl-region-before-first" extent="{$regionBeforeExtent}"/>
      <region-after region-name="xsl-region-after-first" extent="{$regionAfterExtent}"/>
    </simple-page-master>
    <!-- for pages in one-side mode, 2 column -->
    <simple-page-master master-name="simple2" page-width="{$pageWidth}" page-height="{$pageHeight}" margin-top="{$pageMarginTop}" margin-bottom="{$pageMarginBottom}" margin-left="{$pageMarginLeft}" margin-right="{$pageMarginRight}">
      <region-body column-count="{$columnCount}" margin-bottom="{$bodyMarginBottom}" margin-top="{$bodyMarginTop}"/>
      <region-before extent="{$regionBeforeExtent}"/>
      <region-after extent="{$regionAfterExtent}"/>
    </simple-page-master>
    <!-- for left-hand/tei:even pages in twosided mode, 2 column -->
    <simple-page-master master-name="left2" page-width="{$pageWidth}" page-height="{$pageHeight}" margin-top="{$pageMarginTop}" margin-bottom="{$pageMarginBottom}" margin-left="{$pageMarginLeft}" margin-right="{$pageMarginRight}">
      <region-body column-count="{$columnCount}" margin-bottom="{$bodyMarginBottom}" margin-top="{$bodyMarginTop}"/>
      <region-before region-name="xsl-region-before-left" extent="{$regionBeforeExtent}"/>
      <region-after region-name="xsl-region-after-left" extent="{$regionAfterExtent}"/>
    </simple-page-master>
    <!-- for right-hand/tei:odd pages in twosided mode, 2 column -->
    <simple-page-master master-name="right2" page-width="{$pageWidth}" page-height="{$pageHeight}" margin-top="{$pageMarginTop}" margin-bottom="{$pageMarginBottom}" margin-left="{$pageMarginLeft}" margin-right="{$pageMarginRight}">
      <region-body column-count="{$columnCount}" margin-bottom="{$bodyMarginBottom}" margin-top="{$bodyMarginTop}"/>
      <region-before region-name="xsl-region-before-right" extent="{$regionBeforeExtent}"/>
      <region-after region-name="xsl-region-after-right" extent="{$regionAfterExtent}"/>
    </simple-page-master>
    <!-- special case of first page in either mode -->
    <simple-page-master master-name="first2" page-width="{$pageWidth}" page-height="{$pageHeight}" margin-top="{$pageMarginTop}" margin-bottom="{$pageMarginBottom}" margin-left="{$pageMarginLeft}" margin-right="{$pageMarginRight}">
      <region-body column-count="{$columnCount}" margin-bottom="{$bodyMarginBottom}" margin-top="{$bodyMarginTop}"/>
      <region-before region-name="xsl-region-before-first" extent="{$regionBeforeExtent}"/>
      <region-after region-name="xsl-region-after-first" extent="{$regionAfterExtent}"/>
    </simple-page-master>
    <!-- setup for double-sided, 1 column, no first page -->
    <page-sequence-master master-name="twoside1nofirst">
      <repeatable-page-master-alternatives>
        <conditional-page-master-reference master-reference="right1" odd-or-even="odd"/>
        <conditional-page-master-reference master-reference="left1" odd-or-even="even"/>
      </repeatable-page-master-alternatives>
    </page-sequence-master>
    <!-- setup for double-sided, 1 column -->
    <page-sequence-master master-name="twoside1">
      <repeatable-page-master-alternatives>
        <conditional-page-master-reference master-reference="first1" page-position="first"/>
        <conditional-page-master-reference master-reference="right1" odd-or-even="odd"/>
        <conditional-page-master-reference master-reference="left1" odd-or-even="even"/>
      </repeatable-page-master-alternatives>
    </page-sequence-master>
    <!-- setup for single-sided, 1 column -->
    <page-sequence-master master-name="oneside1">
      <repeatable-page-master-alternatives>
        <conditional-page-master-reference master-reference="first1" page-position="first"/>
        <conditional-page-master-reference master-reference="simple1"/>
      </repeatable-page-master-alternatives>
    </page-sequence-master>
    <!-- setup for double-sided, 2 column -->
    <page-sequence-master master-name="twoside2">
      <repeatable-page-master-alternatives>
        <conditional-page-master-reference master-reference="first2" page-position="first"/>
        <conditional-page-master-reference master-reference="right2" odd-or-even="odd"/>
        <conditional-page-master-reference master-reference="left2" odd-or-even="even"/>
      </repeatable-page-master-alternatives>
    </page-sequence-master>
    <!-- setup for single-sided, 2 column -->
    <page-sequence-master master-name="oneside2">
      <repeatable-page-master-alternatives>
        <conditional-page-master-reference master-reference="first2" page-position="first"/>
        <conditional-page-master-reference master-reference="simple2"/>
      </repeatable-page-master-alternatives>
    </page-sequence-master>
    <xsl:call-template name="pageMasterHook"/>
  </layout-master-set>
  <xsl:if test="$foEngine='xep'">
    <!-- PDF bookmarks using XEP -->
    <outline xmlns="http://www.renderx.com/XSL/Extensions">
      <xsl:for-each select="/tei:TEI/tei:text/tei:front/tei:div">
        <xsl:call-template name="makeBookMark"/>
      </xsl:for-each>
      <xsl:for-each select="/tei:TEI/tei:text/tei:body/tei:div">
        <xsl:call-template name="makeBookMark"/>
      </xsl:for-each>
      <xsl:for-each select="/tei:TEI/tei:text/tei:back/tei:div">
        <xsl:call-template name="makeBookMark"/>
      </xsl:for-each>
      <!-- now try numbered divs -->
      <xsl:for-each select="/tei:TEI/tei:text/tei:front/tei:div1">
        <xsl:call-template name="makeBookMarkN"/>
      </xsl:for-each>
      <xsl:for-each select="/tei:TEI/tei:text/tei:body/tei:div1">
        <xsl:call-template name="makeBookMarkN"/>
      </xsl:for-each>
      <xsl:for-each select="/tei:TEI/tei:text/tei:back/tei:div1">
        <xsl:call-template name="makeBookMarkN"/>
      </xsl:for-each>
    </outline>
  </xsl:if>
</xsl:template>
Stylesheet location ../../../fo2/textstructure.xsl
Template makeBookMark
Documentation

Description

[fo] Make an XEP bookmark
Namespace No namespace
Used by
References
Import precedence 3
Source
<xsl:template name="makeBookMark">
  <xsl:if test="tei:head">
    <bookmark xmlns="http://www.renderx.com/XSL/Extensions">
      <xsl:variable name="depth" select="count(ancestor::tei:div)"/>
      <xsl:attribute name="internal-destination">
        <xsl:choose>
          <xsl:when test="@xml:id">
            <xsl:value-of select="@xml:id"/>
          </xsl:when>
          <xsl:otherwise>
            <xsl:value-of select="generate-id()"/>
          </xsl:otherwise>
        </xsl:choose>
      </xsl:attribute>
      <bookmark-label>
        <xsl:if test="$numberHeadings='true' and $numberHeadingsDepth > $depth">
          <xsl:call-template name="calculateNumber">
            <xsl:with-param name="numbersuffix">
              <xsl:call-template name="headingNumberSuffix"/>
            </xsl:with-param>
          </xsl:call-template>
          <xsl:text> </xsl:text>
        </xsl:if>
        <xsl:value-of select="tei:head"/>
      </bookmark-label>
      <xsl:for-each select="tei:div">
        <xsl:call-template name="makeBookMark"/>
      </xsl:for-each>
    </bookmark>
  </xsl:if>
</xsl:template>
Stylesheet location ../../../fo2/textstructure.xsl
Template makeBookMarkN
Documentation

Description

[fo] Make an XEP bookmark for numbered divs
Namespace No namespace
Used by
References
Import precedence 3
Source
<xsl:template name="makeBookMarkN">
  <xsl:if test="tei:head">
    <xsl:variable name="depth" select="substring-after(local-name(.),'div')"/>
    <bookmark xmlns="http://www.renderx.com/XSL/Extensions">
      <xsl:attribute name="internal-destination">
        <xsl:choose>
          <xsl:when test="@xml:id">
            <xsl:value-of select="@xml:id"/>
          </xsl:when>
          <xsl:otherwise>
            <xsl:value-of select="generate-id()"/>
          </xsl:otherwise>
        </xsl:choose>
      </xsl:attribute>
      <bookmark-label>
        <xsl:if test="$numberHeadings='true' and $numberHeadingsDepth > $depth">
          <xsl:call-template name="calculateNumber">
            <xsl:with-param name="numbersuffix">
              <xsl:call-template name="headingNumberSuffix"/>
            </xsl:with-param>
          </xsl:call-template>
          <xsl:text> </xsl:text>
        </xsl:if>
        <xsl:value-of select="tei:head"/>
      </bookmark-label>
      <xsl:choose>
        <xsl:when test="$depth='0'">
          <xsl:for-each select="tei:div1">
            <xsl:call-template name="makeBookMarkN"/>
          </xsl:for-each>
        </xsl:when>
        <xsl:when test="$depth='1'">
          <xsl:for-each select="tei:div2">
            <xsl:call-template name="makeBookMarkN"/>
          </xsl:for-each>
        </xsl:when>
        <xsl:when test="$depth='2'">
          <xsl:for-each select="tei:div3">
            <xsl:call-template name="makeBookMarkN"/>
          </xsl:for-each>
        </xsl:when>
        <xsl:when test="$depth='3'">
          <xsl:for-each select="tei:div4">
            <xsl:call-template name="makeBookMarkN"/>
          </xsl:for-each>
        </xsl:when>
        <xsl:when test="$depth='4'">
          <xsl:for-each select="tei:div5">
            <xsl:call-template name="makeBookMarkN"/>
          </xsl:for-each>
        </xsl:when>
        <xsl:when test="$depth='5'">
          <xsl:for-each select="tei:div6">
            <xsl:call-template name="makeBookMarkN"/>
          </xsl:for-each>
        </xsl:when>
      </xsl:choose>
    </bookmark>
  </xsl:if>
</xsl:template>
Stylesheet location ../../../fo2/textstructure.xsl
Template tocBits
Documentation

Description

[fo]
Namespace No namespace
Used by
Template mainTOC
References
Parameters tocBack; tocFront
Import precedence 3
Source
<xsl:template name="tocBits">
  <xsl:if test="$tocFront='true'">
    <xsl:for-each select="ancestor::tei:text/tei:front//tei:div">
      <xsl:apply-templates mode="toc" select="(.)"/>
    </xsl:for-each>
  </xsl:if>
  <xsl:for-each select="ancestor::tei:text/tei:body//tei:div">
    <xsl:apply-templates mode="toc" select="(.)"/>
  </xsl:for-each>
  <xsl:if test="$tocBack='true'">
    <xsl:for-each select="ancestor::tei:text/tei:back//tei:div">
      <xsl:apply-templates mode="toc" select="(.)"/>
    </xsl:for-each>
  </xsl:if>
</xsl:template>
Stylesheet location ../../../fo2/textstructure.xsl
Template tocheading
Documentation

Description

[fo]

Parameters

level level

Namespace No namespace
Used by
References
Parameters
QName Namespace
level No namespace
Import precedence 3
Source
<xsl:template name="tocheading">
  <xsl:param name="level"/>
  <xsl:variable name="tocindent">
    <xsl:choose>
      <xsl:when test="$level='0'">
        <xsl:value-of select="$div0Tocindent"/>
      </xsl:when>
      <xsl:when test="$level='1'">
        <xsl:value-of select="$div1Tocindent"/>
      </xsl:when>
      <xsl:when test="$level='2'">
        <xsl:value-of select="$div2Tocindent"/>
      </xsl:when>
      <xsl:when test="$level='3'">
        <xsl:value-of select="$div3Tocindent"/>
      </xsl:when>
      <xsl:when test="$level='4'">
        <xsl:value-of select="$div4Tocindent"/>
      </xsl:when>
      <xsl:when test="$level='5'">
        <xsl:value-of select="$div5Tocindent"/>
      </xsl:when>
      <xsl:otherwise>
        <xsl:value-of select="$div1Tocindent"/>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:variable>
  <block>
    <xsl:if test="$level='0'">
      <xsl:attribute name="font-weight">bold</xsl:attribute>
    </xsl:if>
    <xsl:attribute name="text-indent">
      <xsl:value-of select="$tocindent"/>
    </xsl:attribute>
    <xsl:variable name="Number">
      <xsl:if test="$numberHeadings='true' and $numberHeadingsDepth > $level">
        <xsl:call-template name="calculateNumber">
          <xsl:with-param name="numbersuffix" select="$tocNumberSuffix"/>
        </xsl:call-template>
      </xsl:if>
    </xsl:variable>
    <xsl:value-of select="$Number"/>
    <xsl:text></xsl:text>
    <inline>
      <xsl:apply-templates mode="section" select="tei:head"/>
    </inline>
    <leader rule-thickness="0pt"/>
    <inline>
      <xsl:call-template name="linkStyle"/>
      <xsl:variable name="pagref">
        <xsl:choose>
          <xsl:when test="@xml:id">
            <xsl:value-of select="@xml:id"/>
          </xsl:when>
          <xsl:otherwise>
            <xsl:value-of select="generate-id()"/>
          </xsl:otherwise>
        </xsl:choose>
      </xsl:variable>
      <basic-link internal-destination="{$pagref}">
        <page-number-citation ref-id="{$pagref}"/>
      </basic-link>
    </inline>
  </block>
</xsl:template>
Stylesheet location ../../../fo2/textstructure.xsl
Template xheading
Documentation

Description

[fo]

Parameters

level level

Namespace No namespace
Used by
References
Parameters
QName Namespace
level No namespace
Import precedence 3
Source
<xsl:template name="xheading">
  <xsl:param name="level"/>
  <xsl:if test="$numberHeadings='true'">
    <xsl:call-template name="calculateNumber"/>
  </xsl:if>
  <xsl:call-template name="divXRefHeading"/>
</xsl:template>
Stylesheet location ../../../fo2/textstructure.xsl
Template calculateNumber
Documentation

Description

[fo] Work out the number of a section

Parameters

numbersuffix suffix to add after number (typically ". ")

Namespace No namespace
Used by
References
Parameters
QName Namespace
numbersuffix No namespace
Import precedence 3
Source
<xsl:template name="calculateNumber">
  <xsl:param name="numbersuffix"/>
  <xsl:choose>
    <xsl:when test="$prenumberedHeadings='true' and @n">
      <xsl:value-of select="@n"/>
      <xsl:value-of select="$numbersuffix"/>
    </xsl:when>
    <xsl:when test="ancestor::tei:front">
      <xsl:if test="not($numberFrontHeadings='')">
        <xsl:number count="tei:div|tei:div1|tei:div2|tei:div3|tei:div4" format="{$numberFrontHeadings}" from="tei:front" level="multiple"/>
        <xsl:value-of select="$numbersuffix"/>
      </xsl:if>
    </xsl:when>
    <xsl:when test="ancestor::tei:back">
      <xsl:if test="not($numberBackHeadings='')">
        <xsl:call-template name="i18n">
          <xsl:with-param name="word">appendixWords</xsl:with-param>
        </xsl:call-template>
        <xsl:text> </xsl:text>
        <xsl:number count="tei:div|tei:div1|tei:div2|tei:div3|tei:div4" format="{$numberBackHeadings}" from="tei:back" level="multiple"/>
        <xsl:value-of select="$numbersuffix"/>
      </xsl:if>
    </xsl:when>
    <xsl:otherwise>
      <xsl:number count="tei:div|tei:div1|tei:div2|tei:div3|tei:div4" from="tei:body" level="multiple"/>
      <xsl:value-of select="$numbersuffix"/>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location ../../../fo2/textstructure.xsl