OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Page number prefix


Hi,

I went to the customization stylesheet that Jeff Beal provided (and has
moved to some https://github.com/docbook/wiki/wiki/PageNumberPrefixes)
and tried it with a vanilla customization of Oxygen XML editor.
Unfortunately it does not work. The attached stylesheet has only a
hardware break template added. The Testchapterprefix.xml does not
produce page numbers with the correct chapter prefix. What has to be
changed?

Regards,

Bernhard

-- 
spitzhalde9
D-79853 lenzkirch
bernhard.kleine@gmx.net
www.b-kleine.com, www.urseetal.net
-
thunderbird mit enigmail
GPG schlÃssel: D5257409
fingerprint:
08 B7 F8 70 22 7A FC C1 15 49 CA A6 C7 6F A0 2E D5 25 74 09

<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="http://docbook.org/xml/5.1/rng/docbookxi.rng"; 
    schematypens="http://relaxng.org/ns/structure/1.0";?>
<?xml-model href="http://docbook.org/xml/5.1/sch/docbook.sch"; 
    type="application/xml" 
    schematypens="http://purl.oclc.org/dsdl/schematron";?>
<book xmlns="http://docbook.org/ns/docbook"; xml:lang="de" xmlns:xi="http://www.w3.org/2001/XInclude";
    xmlns:ns5="http://www.w3.org/2000/svg"; xmlns:ns="http://docbook.org/ns/docbook";
    xmlns:xlink="http://www.w3.org/1999/xlink"; version="5.1">
    <chapter>
        <title>chap1</title>
        <para>Test test</para>
        <sect1><title>sect1</title>
            <para>Test test</para>
        </sect1>
        <?hard-pagebreak?>
        <sect1><title>sect2</title>
            <para>Test test</para>
        </sect1>
        <?hard-pagebreak?>
        <sect1><title>sect3</title>
            <para>Test test</para>
            <?hard-pagebreak?>
            <para>Test test</para>
            <?hard-pagebreak?>
            <para>Test test</para>
            <?hard-pagebreak?>
        </sect1>
    </chapter>
    <chapter>
        <title>chap2</title>
        <para>Test test</para>
        <?hard-pagebreak?>
        <para>Test test</para>
        <?hard-pagebreak?>
        <para>Test test</para>
        <?hard-pagebreak?>
        <para>Test test</para>
    </chapter>
    <appendix>
        <title>Anhang</title>
        <para>test test</para>
        
    </appendix>
   
  
    <colophon status="devel">
        <title>Zusammenfassung</title>
        <para>Letzte Version vom: <?dbtimestamp format="d-m-Y"?></para>
        <para><emphasis role="bold">Letzte Ã?nderungen:</emphasis></para>
        

        <para><emphasis role="bold">Falter in Lenzkirch</emphasis></para>
        <para>ist die private Sammlung von Fotos von Bernhard Kleine aus 10 Jahren Fotografieren in
            Lenzkirch. Es ist bei weitem nicht das vollständige Inventar der Falter in Lenzkirch.
            Höchstens bei den Tagfalter ist die Zahl schon nahe der zu erwartenden Falter. Für den
            Landkreis Breisgau-Hochschwarzwald sind 108 Tagfalter beschrieben; rechnet man die
            Falter ab, die wegen der Höhe von Lenzkirch keine Chance habe, sich hier zu vermehren,
            ist mit 67 beobachtete Tagfalterarten ein wesentlicher Teil des Vorkommens fotografiert.
            Die Palette an Nachtfalter und Kleinschmetterlingen wird sich sicher in den nächsten
            Jahren erweitern. Deshalb liegt dieses Werk Loseblattsammlung im Ringbuch vor, das bei
            neuen Funden ergänzt werden soll. </para>
        <para>Aktuelle Fundmeldungen von neuen Faltern finden sich auch auf der Internetseite
            www.urseetal.net.</para>
        <para>Eigenverlag, Lenzkirch</para>
        <para>Copyright ©2018 Bernhard Kleine, Lenzkirch</para>
        <para>Das Titelbild (im Manuskript nicht vorhanden!) zeigt einen Braunen Bär (Arctia caja)
            vom 29. Juli 2018 aus dem Urseetal.</para>
        <para/>
    </colophon>
</book>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet [

<!ENTITY lowercase "'abcdefghijklmnopqrstuvwxyz'">
<!ENTITY uppercase "'ABCDEFGHIJKLMNOPQRSTUVWXYZ'">

<!ENTITY primary   'normalize-space(concat(primary/@sortas, primary[not(@sortas)]))'>
<!ENTITY secondary 'normalize-space(concat(secondary/@sortas, secondary[not(@sortas)]))'>
<!ENTITY tertiary  'normalize-space(concat(tertiary/@sortas, tertiary[not(@sortas)]))'>
<!ENTITY scope 'count(ancestor::node()|$scope) = count(ancestor::node())'>
<!ENTITY sep '" "'>
]><xsl:stylesheet 
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
    xmlns:d="http://docbook.org/ns/docbook"; 	
	xmlns:fo="http://www.w3.org/1999/XSL/Format";
    version="1.0">
    <xsl:import href="http://docbook.sourceforge.net/release/xsl-ns/current/fo/docbook.xsl"/>
    <xsl:param name="paper.type" select="'a4'"/>
    <xsl:param name="page.orientation" select="'portrait'"/>
    <xsl:param name="body.start.indent">0cm</xsl:param>
    <xsl:param name="local.l10n.xml" select="document('')"/>
    <l:i18n xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0";>
        <l:l10n language="de">
            <l:context name="title">
                <!-- formatiert Tabellen und Abbildungstitel -->
                <l:template name="table" text="Tabelleâ?¯%t."/>
                <l:template name="figure" text="Bildâ?¯%n"/>
            </l:context>
            <l:context name="xref-number-and-title">
                <l:template name="table" text="(in Tab.â?¯%t; (S.â?¯%p)"/>
                <l:template name="figure" text="(Bildâ?¯%n; S.â?¯%p)"/>
                <l:template name="chapter" text="Kapitelâ?¯%n (S.â?¯%p)"/>
                <l:template name="entry" style="seite" text="S.â?¯%p"/>
                <l:template name="mediaobject" style="seite" text="S.â?¯%p"/>
            </l:context>
            <l:context name="xref">
                <l:template name="sect1" style="PageInParen1" text=" (S.â?¯%p)"/>
                <l:template name="sect2" style="PageInParen2" text=" (S.â?¯%p)"/>
                <l:template name="sect3" style="PageInParen2" text=" (S.â?¯%p)"/>
                <l:template name="sect4" style="PageInParen2" text=" (S.â?¯%p)"/>
                <l:template name="entry" style="PageInParenE" text=" (S.â?¯%p)"/>
                <l:template name="footnote" style="fussnotenref" text="FuÃ?note S.â?¯%p"/>
            </l:context>
        </l:l10n>
    </l:i18n>
    <xsl:template match="processing-instruction('hard-pagebreak')">
        <fo:block break-after="page"/>
        <!-- fügt einen Seitenumbruch ein -->
    </xsl:template>
    <xsl:template match="processing-instruction('linebreak')">
        <fo:block/>
        <!-- fügt eines Zeilenumbruch ein -->
    </xsl:template>
    <xsl:param name="caption.align">justify</xsl:param>
    <!-- definiert die Ausrichtung und Einrückung von Caption -->
    <xsl:template match="d:mediaobject/d:caption">
        <!-- Beginn des Templates-->
        <fo:block role="caption" xsl:use-attribute-sets="captionlayout.properties">
           <!-- Testet ob der obige Parameter in der Liste enthalten -->
            <xsl:if
                test="
                    $caption.align = 'right' or
                    $caption.align = 'left' or
                    $caption.align = 'justify' or
                    $caption.align = 'center'">
                <xsl:attribute name="text-align">
                    <xsl:value-of select="$caption.align"/>
                </xsl:attribute>
            </xsl:if>
            <xsl:apply-templates/>
            <!-- wendet das Template an -->
        </fo:block>
    </xsl:template>
    <xsl:attribute-set name="captionlayout.properties">
        <xsl:attribute name="margin-left">5em</xsl:attribute>
        <xsl:attribute name="margin-right">5em</xsl:attribute>
        <xsl:attribute name="font-size">10pt</xsl:attribute>
    </xsl:attribute-set>
    <xsl:template match="d:literallayout">
        <!-- für ein Gedicht -->
        <fo:block xsl:use-attribute-sets="literallayout.properties">
            <xsl:apply-templates/>
        </fo:block>
    </xsl:template>
    <xsl:attribute-set name="literallayout.properties">
        <xsl:attribute name="margin-left">5em</xsl:attribute>
        <xsl:attribute name="font-size">10pt</xsl:attribute>
    </xsl:attribute-set>
    <xsl:template match="d:para[@role = 'zitat']">
        <!-- für ein mehrzeiliges Textzitat -->
        <fo:block xsl:use-attribute-sets="zitatlayout.properties">
            <xsl:apply-templates/>
        </fo:block>
    </xsl:template>
    <xsl:attribute-set name="zitatlayout.properties">
        <xsl:attribute name="margin-left">3em</xsl:attribute>
        <xsl:attribute name="margin-right">3em</xsl:attribute>
        <xsl:attribute name="font-size">10pt</xsl:attribute>
    </xsl:attribute-set>
    <xsl:attribute-set name="figure.properties">
        <xsl:attribute name="keep-together.within-column">
            <xsl:choose>
                <xsl:when test="count(d:mediaobject) &gt; 1">inherit</xsl:when>
                <xsl:otherwise>always</xsl:otherwise>
            </xsl:choose>
        </xsl:attribute>
    </xsl:attribute-set>
    <xsl:template match="d:para"> <!-- In kompakten Listen para-Abstand anpassen --> 
        <xsl:variable name="keep.together">
            <xsl:call-template name="pi.dbfo_keep-together"/>
        </xsl:variable>
        <fo:block xsl:use-attribute-sets="para.properties">
            <xsl:if test="$keep.together != ''">
                <xsl:attribute name="keep-together.within-column"><xsl:value-of
                    select="$keep.together"/></xsl:attribute>
            </xsl:if>
            <xsl:if test="ancestor::*/@spacing = 'compact'">
                <xsl:attribute name="space-before.optimum">0.2em</xsl:attribute>
                <xsl:attribute name="space-before.minimum">0.1em</xsl:attribute>
                <xsl:attribute name="space-before.maximum">.3em</xsl:attribute>
            </xsl:if>
            <xsl:call-template name="anchor"/>
            <xsl:apply-templates/>
        </fo:block>
    </xsl:template>
	
	<xsl:template name="toc.line">
    <xsl:variable name="id">
      <xsl:call-template name="object.id"/>
    </xsl:variable>
    
    <xsl:variable name="label">
      <xsl:apply-templates select="." mode="label.markup">
        <xsl:with-param name="purpose" select="'toc'"/>
      </xsl:apply-templates>
    </xsl:variable>
    
    <fo:block text-align-last="justify"
      end-indent="{$toc.indent.width}pt"
      last-line-end-indent="-{$toc.indent.width}pt">
      <fo:inline keep-with-next.within-line="always">
        <fo:basic-link internal-destination="{$id}">
          <xsl:if test="$label != ''">
            <xsl:copy-of select="$label"/>
            <xsl:value-of select="$autotoc.label.separator"/>
          </xsl:if>
          <xsl:apply-templates select="." mode="title.markup"/>
        </fo:basic-link>
      </fo:inline>
      <fo:inline keep-together.within-line="always">
        <xsl:text> </xsl:text>
        <fo:leader leader-pattern="dots"
          leader-pattern-width="3pt"
          leader-alignment="reference-area"
          keep-with-next.within-line="always"/>
        <xsl:text> </xsl:text> 
        <fo:basic-link internal-destination="{$id}">
          <xsl:apply-templates mode="page-number-prefix" select="."/>
          <fo:page-number-citation ref-id="{$id}"/>
        </fo:basic-link>
      </fo:inline>
    </fo:block>
  </xsl:template>

<xsl:template match="d:indexterm" mode="reference">
  <xsl:param name="scope" select="."/>
  <xsl:param name="separator" select="', '"/>

  <xsl:if test="$passivetex.extensions = '0'">
    <xsl:value-of select="$separator"/>
  </xsl:if>

  <xsl:choose>
    <xsl:when test="@zone and string(@zone)">
      <xsl:call-template name="reference">
        <xsl:with-param name="zones" select="normalize-space(@zone)"/>
        <xsl:with-param name="scope" select="$scope"/>
      </xsl:call-template>
    </xsl:when>
    <xsl:otherwise>
      <xsl:variable name="id">
        <xsl:call-template name="object.id"/>
      </xsl:variable>

      <fo:basic-link internal-destination="{$id}">
        <xsl:apply-templates mode="page-number-prefix" select="."/>
        <fo:page-number-citation ref-id="{$id}"/>
      </fo:basic-link>

      <xsl:if test="key('endofrange', @id)[&scope;]">
        <xsl:apply-templates select="key('endofrange', @id)[&scope;][last()]"
                             mode="reference">
          <xsl:with-param name="scope" select="$scope"/>
          <xsl:with-param name="separator" select="'-'"/>
        </xsl:apply-templates>
      </xsl:if>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>

<xsl:template name="reference">
  <xsl:param name="scope" select="."/>
  <xsl:param name="zones"/>

  <xsl:choose>
    <xsl:when test="contains($zones, ' ')">
      <xsl:variable name="zone" select="substring-before($zones, ' ')"/>
      <xsl:variable name="target" select="key('id', $zone)[&scope;]"/>

      <xsl:variable name="id">
        <xsl:call-template name="object.id">
           <xsl:with-param name="object" select="$target[1]"/>
        </xsl:call-template>
      </xsl:variable>

      <fo:basic-link internal-destination="{$id}">
        <xsl:apply-templates mode="page-number-prefix" select="$target[1]"/>
        <fo:page-number-citation ref-id="{$id}"/>
      </fo:basic-link>

      <xsl:if test="$passivetex.extensions = '0'">
        <xsl:text>, </xsl:text>
      </xsl:if>
      <xsl:call-template name="reference">
        <xsl:with-param name="zones" select="substring-after($zones, ' ')"/>
        <xsl:with-param name="scope" select="$scope"/>
      </xsl:call-template>
    </xsl:when>
    <xsl:otherwise>
      <xsl:variable name="zone" select="$zones"/>
      <xsl:variable name="target" select="key('id', $zone)[&scope;]"/>

      <xsl:variable name="id">
        <xsl:call-template name="object.id">
          <xsl:with-param name="object" select="$target[1]"/>
        </xsl:call-template>
      </xsl:variable>

      <fo:basic-link internal-destination="{$id}">
        <xsl:apply-templates mode="page-number-prefix" select="$target[1]"/>
        <fo:page-number-citation ref-id="{$id}"/>
      </fo:basic-link>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>

<xsl:template match="d:indexterm" mode="reference-markup">
  <xsl:param name="scope" select="."/>
  <xsl:choose>
    <xsl:when test="@zone and string(@zone)">
      <xsl:call-template name="reference-markup">
        <xsl:with-param name="zones" select="normalize-space(@zone)"/>
        <xsl:with-param name="scope" select="$scope"/>
      </xsl:call-template>
    </xsl:when>
    <xsl:otherwise>
      <xsl:variable name="id">
        <xsl:call-template name="object.id"/>
      </xsl:variable>


      <xsl:choose>
        <xsl:when test="@startref and @class='endofrange'">
          <xsl:text>&lt;phrase role="pageno"&gt;</xsl:text>
          <xsl:text>&lt;link linkend="</xsl:text>
          <xsl:value-of select="@startref"/>
          <xsl:text>"&gt;</xsl:text>
          <fo:basic-link internal-destination="{@startref}">
            <xsl:apply-templates mode="page-number-prefix" select="."/>
            <fo:page-number-citation ref-id="{@startref}"/>
            <xsl:text>-</xsl:text>
            <fo:page-number-citation ref-id="{$id}"/>
          </fo:basic-link>
          <xsl:text>&lt;/link&gt;</xsl:text>
          <xsl:text>&lt;/phrase&gt;&#10;</xsl:text>
        </xsl:when>
        <xsl:otherwise>
          <xsl:text>&lt;phrase role="pageno"&gt;</xsl:text>
          <xsl:if test="@id">
            <xsl:text>&lt;link linkend="</xsl:text>
            <xsl:value-of select="$id"/>
            <xsl:text>"&gt;</xsl:text>
          </xsl:if>
          <fo:basic-link internal-destination="{$id}">
            <xsl:apply-templates mode="page-number-prefix" select="."/>
            <fo:page-number-citation ref-id="{$id}"/>
          </fo:basic-link>
          <xsl:if test="@id">
            <xsl:text>&lt;/link&gt;</xsl:text>
          </xsl:if>
          <xsl:text>&lt;/phrase&gt;&#10;</xsl:text>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>

<xsl:template name="reference-markup">
  <xsl:param name="scope" select="."/>
  <xsl:param name="zones"/>
  <xsl:choose>
    <xsl:when test="contains($zones, ' ')">
      <xsl:variable name="zone" select="substring-before($zones, ' ')"/>
      <xsl:variable name="target" select="key('id', $zone)[&scope;]"/>

      <xsl:variable name="id">
        <xsl:call-template name="object.id">
          <xsl:with-param name="object" select="$target[1]"/>
        </xsl:call-template>
      </xsl:variable>

      <xsl:text>&lt;phrase fole="pageno"&gt;</xsl:text>
      <xsl:if test="$target[1]/@id">
        <xsl:text>&lt;link linkend="</xsl:text>
        <xsl:value-of select="$id"/>
        <xsl:text>"&gt;</xsl:text>
      </xsl:if>
      <fo:basic-link internal-destination="{$id}">
        <xsl:apply-templates mode="page-number-prefix" select="$target[1]"/>
        <fo:page-number-citation ref-id="{$id}"/>
      </fo:basic-link>
      <xsl:if test="$target[1]/@id">
        <xsl:text>&lt;/link&gt;</xsl:text>
      </xsl:if>
      <xsl:text>&lt;/phrase&gt;&#10;</xsl:text>

      <xsl:call-template name="reference">
        <xsl:with-param name="zones" select="substring-after($zones, ' ')"/>
        <xsl:with-param name="scope" select="$scope"/>
      </xsl:call-template>
    </xsl:when>
    <xsl:otherwise>
      <xsl:variable name="zone" select="$zones"/>
      <xsl:variable name="target" select="key('id', $zone)[&scope;]"/>

      <xsl:variable name="id">
        <xsl:call-template name="object.id">
          <xsl:with-param name="object" select="$target[1]"/>
        </xsl:call-template>
      </xsl:variable>

      <xsl:text>&lt;phrase role="pageno"&gt;</xsl:text>
      <xsl:if test="$target[1]/@id">
        <xsl:text>&lt;link linkend="</xsl:text>
        <xsl:value-of select="$id"/>
        <xsl:text>"&gt;</xsl:text>
      </xsl:if>
      <fo:basic-link internal-destination="{$id}">
        <xsl:apply-templates mode="page-number-prefix" select="$target[1]"/>
        <fo:page-number-citation ref-id="{$id}"/>
      </fo:basic-link>
      <xsl:if test="$target[1]/@id">
        <xsl:text>&lt;/link&gt;</xsl:text>
      </xsl:if>
      <xsl:text>&lt;/phrase&gt;&#10;</xsl:text>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>


<xsl:template name="footer.content">
  <xsl:param name="pageclass" select="''"/>
  <xsl:param name="sequence" select="''"/>
  <xsl:param name="position" select="''"/>
  <xsl:param name="gentext-key" select="''"/>

<!--
  <fo:block>
    <xsl:value-of select="$pageclass"/>
    <xsl:text>, </xsl:text>
    <xsl:value-of select="$sequence"/>
    <xsl:text>, </xsl:text>
    <xsl:value-of select="$position"/>
    <xsl:text>, </xsl:text>
    <xsl:value-of select="$gentext-key"/>
  </fo:block>
-->

  <fo:block>

    <!-- sequence can be odd, even, first, blank -->
    <!-- position can be left, center, right -->
    <xsl:choose>
      <xsl:when test="$pageclass='titlepage'">
        <!-- nop: other titlepage sequences have no footer -->
      </xsl:when>
      <xsl:when test="$pageclass='lot' and $position = 'first'">
        <xsl:apply-templates mode="page-number-prefix" select="."/>
        <fo:page-number/>
      </xsl:when>

      <xsl:when test="$sequence='blank'">
        <xsl:choose>
          <xsl:when test="$double.sided != 0 and $position = 'left'">
            <xsl:apply-templates mode="page-number-prefix" select="."/>
            <fo:page-number/>
          </xsl:when>
          <xsl:when test="$double.sided = 0 and $position = 'center'">
            <xsl:apply-templates mode="page-number-prefix" select="."/>
            <fo:page-number/>
          </xsl:when>
          <xsl:otherwise>
            <!-- nop -->
          </xsl:otherwise>
        </xsl:choose>
      </xsl:when>

      <xsl:when test="starts-with($gentext-key,'refentry')
                      and $sequence='first' and $position='right'">
        <xsl:apply-templates mode="page-number-prefix" select="."/>
        <fo:page-number/>
      </xsl:when>

      <xsl:when test="$double.sided != 0 and $sequence = 'even' and $position='left'">
        <xsl:apply-templates mode="page-number-prefix" select="."/>
        <fo:page-number/>
      </xsl:when>

      <xsl:when test="$double.sided != 0 and $sequence = 'odd' and $position='right'">
        <xsl:apply-templates mode="page-number-prefix" select="."/>
        <fo:page-number/>
      </xsl:when>

      <xsl:otherwise>
        <!-- nop -->
      </xsl:otherwise>
    </xsl:choose>
  </fo:block>
</xsl:template>

<xsl:template match="d:chapter">
  <xsl:variable name="id">
    <xsl:call-template name="object.id"/>
  </xsl:variable>

  <xsl:variable name="master-reference">
    <xsl:call-template name="select.pagemaster"/>
  </xsl:variable>

  <fo:page-sequence id="{$id}"
                    hyphenate="{$hyphenate}"
                    master-reference="{$master-reference}">
    <xsl:attribute name="language">
      <xsl:call-template name="l10n.language"/>
    </xsl:attribute>
    <xsl:attribute name="format">
      <xsl:call-template name="page.number.format"/>
    </xsl:attribute>
    <xsl:choose>
      <xsl:when test="not(preceding::chapter
                          or preceding::appendix
                          or preceding::article
                          or preceding::dedication
                          or parent::part
                          or parent::reference)">
        <!-- if there is a preceding component or we're in a part, the -->
        <!-- page numbering will already be adjusted -->
        <xsl:attribute name="initial-page-number">1</xsl:attribute>
      </xsl:when>
      <xsl:when test="$double.sided != 0">
        <xsl:attribute name="initial-page-number">1</xsl:attribute>
      </xsl:when>
    </xsl:choose>

    <xsl:apply-templates select="." mode="running.head.mode">
      <xsl:with-param name="master-reference" select="$master-reference"/>
    </xsl:apply-templates>

    <xsl:apply-templates select="." mode="running.foot.mode">
      <xsl:with-param name="master-reference" select="$master-reference"/>
    </xsl:apply-templates>

    <fo:flow flow-name="xsl-region-body">
      <xsl:call-template name="chapter.titlepage"/>

      <xsl:variable name="toc.params">
        <xsl:call-template name="find.path.params">
          <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
        </xsl:call-template>
      </xsl:variable>
      <xsl:if test="contains($toc.params, 'toc')">
        <xsl:call-template name="component.toc"/>
      </xsl:if>
      <xsl:apply-templates/>
    </fo:flow>
  </fo:page-sequence>
</xsl:template>

<xsl:template match="d:book/d:index|d:part/d:index">
  <xsl:variable name="id">
    <xsl:call-template name="object.id"/>
  </xsl:variable>

 <xsl:if test="$generate.index != 0">
  <xsl:variable name="master-reference">
    <xsl:call-template name="select.pagemaster">
      <xsl:with-param name="pageclass">
        <xsl:if test="$make.index.markup != 0">body</xsl:if>
      </xsl:with-param>
    </xsl:call-template>
  </xsl:variable>

  <fo:page-sequence id="{$id}"
                    hyphenate="{$hyphenate}"
                    master-reference="{$master-reference}">
    <xsl:attribute name="language">
      <xsl:call-template name="l10n.language"/>
    </xsl:attribute>
    <xsl:attribute name="format">
      <xsl:call-template name="page.number.format"/>
    </xsl:attribute>
    <xsl:attribute name="initial-page-number">1</xsl:attribute>

    <xsl:apply-templates select="." mode="running.head.mode">
      <xsl:with-param name="master-reference" select="$master-reference"/>
    </xsl:apply-templates>
    <xsl:apply-templates select="." mode="running.foot.mode">
      <xsl:with-param name="master-reference" select="$master-reference"/>
    </xsl:apply-templates>

    <fo:flow flow-name="xsl-region-body">
      <xsl:call-template name="index.titlepage"/>
      <xsl:apply-templates/>
      <xsl:if test="count(indexentry) = 0 and count(indexdiv) = 0">

        <xsl:choose>
          <xsl:when test="$make.index.markup != 0">
            <fo:block wrap-option='no-wrap'
                      white-space-collapse='false'
                      xsl:use-attribute-sets="monospace.verbatim.properties"
                      linefeed-treatment="preserve">
              <xsl:call-template name="generate-index-markup">
                <xsl:with-param name="scope" select="(ancestor::book|/)[last()]"/>
              </xsl:call-template>
            </fo:block>
          </xsl:when>
          <xsl:when test="indexentry|indexdiv/indexentry">
            <xsl:apply-templates/>
          </xsl:when>
          <xsl:otherwise>
            <xsl:call-template name="generate-index">
              <xsl:with-param name="scope" select="(ancestor::book|/)[last()]"/>
            </xsl:call-template>
          </xsl:otherwise>
        </xsl:choose>
      </xsl:if>
    </fo:flow>
  </fo:page-sequence>
 </xsl:if>
</xsl:template>


<xsl:template match="d:chapter|d:chapter//*" mode="page-number-prefix">
  <xsl:number count="chapter" from="book" level="any"/>
  <xsl:text>&#x2013;</xsl:text>
</xsl:template>

<xsl:template match="d:appendix|d:appendix//*" mode="page-number-prefix">
  <xsl:number count="appendix" from="book" level="single" format="A"/>
  <xsl:text>&#x2013;</xsl:text>
</xsl:template>

<xsl:template match="d:glossary|d:glossary//*" mode="page-number-prefix">
  <xsl:variable name="glossname">
    <xsl:call-template name="gentext">
      <xsl:with-param name="key" select="'glossary'"/>
    </xsl:call-template>
  </xsl:variable>
  <xsl:value-of select="substring($glossname,1,1)"/>
  <xsl:text>&#x2013;</xsl:text>
</xsl:template>

<xsl:template match="d:index|d:index//*" mode="page-number-prefix">
  <xsl:call-template name="gentext">
    <xsl:with-param name="key" select="'index'"/>
  </xsl:call-template>
  <xsl:text>&#x2013;</xsl:text>
</xsl:template>

<xsl:template match="d:reference|d:reference//*" mode="page-number-prefix">
  <xsl:apply-templates select="preceding::chapter[1]" mode="page-number-prefix"/>
</xsl:template>

<xsl:template match="d:refentry|d:refentry//*" mode="page-number-prefix">
  <xsl:apply-templates select="preceding::chapter[1]" mode="page-number-prefix"/>
</xsl:template>

<xsl:template match="d:*" mode="page-number-prefix"/>
</xsl:stylesheet>

Attachment: signature.asc
Description: OpenPGP digital signature



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]