Setting up headers and footers for preface topics

Here should go questions about transforming XML with XSLT and FOP.
chrizzbee
Posts: 37

Setting up headers and footers for preface topics

Mon Jun 12, 2017 6:18 pm

I struggle with headers and footers for my preface topics. I use the latest OT 2.5.

Consider this bookmap structure:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE bookmap PUBLIC "-//OASIS//DTD DITA BookMap//EN" "bookmap.dtd">
<bookmap>
    <booktitle>
        <mainbooktitle>Preface Test Map</mainbooktitle>
    </booktitle>
    <frontmatter>
        <preface href="preface1.dita"/>
        <preface href="preface2.dita"/>
        <preface href="preface3.dita"/>
        <booklists>
            <toc/>
        </booklists>
    </frontmatter>
</bookmap>


I set force_page_count to "auto" in order to have a straight page flow without any blank pages and continuous numbering. When I publish to PDF, I get this result: https://www.dropbox.com/s/7cn6kz4qbyy4wz4/bookmap.pdf?dl=0.

In order to know what header information actually is written in each preface topic, I modified en.xml with ODD, EVEN and FIRST infos:

Code: Select all

<!-- The header that appears on Preface odd-numbered pages. -->
    <variable id="Preface odd header"><param ref-name="prodname"/> |ODD| <param ref-name="pagenum"/></variable>

    <!-- The header that appears on Preface even-numbered pages. -->
    <variable id="Preface even header"><param ref-name="pagenum"/> |EVEN| <param ref-name="prodname"/></variable>

    <!-- The header that appears on Preface first page. -->
    <variable id="Preface first header"><param ref-name="pagenum"/> |FIRST| <param ref-name="prodname"/></variable>


My expectation was that the first preface starts EVEN, the second ODD and the third again EVEN. Instead, the second starts FIRST. The first and third don't even output any header information at all and therefore no styling can be applied.

Is this a bug in the OT? Of course, if I set force_page_count to "even" then every preface topic is FIRST, so this is correct. But with "auto" there seems to be some hick-up. If I replicate this in OT 1.8.5, then I get a different result: first preface is ODD, the second FIRST and the third again ODD. Here at least the header output works somehow, but still not consistently ODD/EVEN as I would expect it. See example: https://www.dropbox.com/s/1tnjtd3hv9z9ntj/bookmap_185.pdf?dl=0

Thanks for clarification.
Chris.
chrizzbee
Posts: 37

Re: Setting up headers and footers for preface topics

Tue Jun 20, 2017 5:20 pm

After some fiddling with the code, I realized i can set in "generate-page-sequence-master" first and last to false:

Code: Select all

    <xsl:param name="first" select="false()"/>
    <xsl:param name="last" select="false()"/>


Now my preface-pages pick up the headers and footers correctly.

Return to “XSLT and FOP”

Who is online

Users browsing this forum: No registered users and 1 guest