How do I change the format of footer page numbers on TOC pages?

307 views
Skip to first unread message

Greg Wait

unread,
Aug 11, 2016, 11:22:47 AM8/11/16
to DITA-OT Users
For my PDF plugin I want all pages after the cover page to carry the same footer. In all other regards I've achieved this, EXCEPT that the page numbers displayed in the footer of TOC pages are in lower-case roman numerals (format="i") rather than numerals (format="1"). I have tried various fixes but ultimately have no idea where the format is being set for TOC footers. I have searched and made test changes to all the obvious places (toc-attr, static-content-attr, basic-settings-attr, commons-attr... pretty much every file that I could think of once I'd eliminated the obvious ones.

Thanks in advance for your help!

- G

Joe Williams

unread,
Aug 11, 2016, 12:40:20 PM8/11/16
to Greg Wait, DITA-OT Users
Do a find in files for 'format="i"'. One instance should be in the "createToc" template in the following "if" statement: 

        <xsl:if test="count(exsl:node-set($toc)/*) > 0">
            <fo:page-sequence master-reference="toc-sequence"
                xsl:use-attribute-sets="__force__page__count" format="i">

Change it to format="1". 



--
You received this message because you are subscribed to the Google Groups "DITA-OT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dita-ot-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Greg Wait

unread,
Aug 11, 2016, 1:25:13 PM8/11/16
to DITA-OT Users, trespas...@gmail.com
Before posting my question I searched through all files and found no instance of 'format="i".' 

I'm using DITA-OT 2.2.2. The boilerplate PDF2 plugin has no "if" statement in createToc, and no "format=" either. Here is the code:

<xsl:template name="createToc">
      <xsl:if test="$generate-toc">
        <xsl:variable name="toc">
            <xsl:choose>
                <xsl:when test="$map//*[contains(@class,' bookmap/toc ')][@href]"/>
                <xsl:when test="$map//*[contains(@class,' bookmap/toc ')]">
                    <xsl:apply-templates select="/" mode="toc"/>
                </xsl:when>
                <xsl:when test="/*[contains(@class,' map/map ')][not(contains(@class,' bookmap/bookmap '))]">
                    <xsl:apply-templates select="/" mode="toc"/>
                    <xsl:call-template name="toc.index"/>
                </xsl:when>
            </xsl:choose>
        </xsl:variable>
        <xsl:if test="count($toc/*) > 0">
            <fo:page-sequence master-reference="toc-sequence" xsl:use-attribute-sets="page-sequence.toc">
                <xsl:call-template name="insertTocStaticContents"/>
                <fo:flow flow-name="xsl-region-body">
                    <xsl:call-template name="createTocHeader"/>
                    <fo:block>
                        <fo:marker marker-class-name="current-header">
                          <xsl:call-template name="getVariable">
                            <xsl:with-param name="id" select="'Table of Contents'"/>
                          </xsl:call-template>
                        </fo:marker>
                        <xsl:copy-of select="$toc"/>
                    </fo:block>
                </fo:flow>
            </fo:page-sequence>
        </xsl:if>
      </xsl:if>
    </xsl:template>

Joe Williams

unread,
Aug 11, 2016, 4:26:50 PM8/11/16
to Greg Wait, DITA-OT Users
I am using an older version of the OT. I would suggest chasing down the attribute sets until you see where it is inheriting the Arabic numbering. Or, you could just add the format attribute to that page sequence where you want the lowercase roman. I don't like overriding things if I am not sure exactly what I am overriding, but it could give you some clues as to what is going on. Maybe a toolkit developer will see this thread.

Joe Williams

unread,
Aug 11, 2016, 6:35:34 PM8/11/16
to Greg Wait, DITA-OT Users
Found it in cfg/fo/attrs/commons-attr.xsl.

  <xsl:attribute-set name="page-sequence.toc" use-attribute-sets="__force__page__count">
    <xsl:attribute name="format">i</xsl:attribute>
  </xsl:attribute-set>

Greg Wait

unread,
Aug 12, 2016, 10:39:54 AM8/12/16
to DITA-OT Users, trespas...@gmail.com
Awesome! 

Of course, I'd been searching for "format="i"" and hadn't thought to search for "<xsl:attribute name="format">i</xsl:attribute>". No wonder I couldn't find it. Rookie mistake. Thanks for the help!

- G
Reply all
Reply to author
Forward
0 new messages