xsl-list
[Top] [All Lists]

Re: [xsl] XSL-FO: Suppressing Header on First Page of Chapter

2006-03-20 13:31:36
Hi Jordan,

This can be done by setting up a page-sequence-master that uses different page-masters for its first and subsequent pages.

An example is provided in the Docbook XSL-FO documentation: see

http://www.sagehill.net/docbookxsl/PageDesign.html

This is also documented in any reasonably decent book about how to use XSL-FO. But if you get the names of the elements you need from the docbook page, you can probably work out what you want to do from the spec and other resources.

You'd have a new page sequence for each chapter, which would flow the chapter into a sequence of pages, only the first of which would use a special "first-page" design. So you'd have something like

<fo:page-sequence-master master-name="chapter">
    <fo:repeatable-page-master-alternatives>
        <fo:conditional-page-master-reference
                  master-reference="chapter-first"
                  page-position="first"/>
        <fo:conditional-page-master-reference
                  master-reference="rector"
                  odd-or-even="odd"/>
        <fo:conditional-page-master-reference
                  master-reference="verso"
                  odd-or-even="even"/>
        <fo:conditional-page-master-reference
                  master-reference="blank"
                  blank-or-not-blank="blank"/>
    </fo:repeatable-page-master-alternatives>
</fo:page-sequence-master>

Enjoy,
Wendell

At 12:44 AM 3/19/2006, you wrote:
Hey folks,

I'm trying to create a book-quality PDF, including headers, running
footers, odd and even pages, etc.  I've been stumped by one problem
however, so I'm requesting some advice.

At the beginning of each chapter (which is on a new page), I have a
large-font title on it.  On these pages (and only these pages), I want to
suppress the header section (as you often see in published books).  I
searched Google and couldn't find anything directly relevant.

I'm not exactly sure how what approach to take with this.  I could use a
new page-sequence, but I'm not sure how I'd call it just for the one
page.  Alternatively, I was thinking there may be a way to suppress it
with a xsl:if when displaying the header, but I have no idea what sort of
condition to use.

A short example of my XML is as follows:

<div1>
  <div2 title="Chapter 1">
    <p>...</p>
  </div2>
  <div2 title="Chapter 2">
    <p>...</p>
  </div2>
  <div2 title="Chapter 3">
    <p>...</p>
  </div2>
</div1>

And my main p.s.m. (which generates all the content):

<fo:page-sequence-master master-name="body">
  <fo:repeatable-page-master-alternatives>
    <fo:conditional-page-master-reference master-reference="BodyRight"
odd-or-even="odd" />
    <fo:conditional-page-master-reference master-reference="BodyLeft"
odd-or-even="even" />
  </fo:repeatable-page-master-alternatives>
</fo:page-sequence-master>


Obviously, those div2 elements would generate numerous pages each.  I can
provide some more XSL if that would be helpful, but it didn't see that as
necessary at this point.

Thanks for any guidance you can provide,
Jordan D.

BTW, I'm using FOP 0.20.5

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--


======================================================================
Wendell Piez                            
mailto:wapiez(_at_)mulberrytech(_dot_)com
Mulberry Technologies, Inc.                http://www.mulberrytech.com
17 West Jefferson Street                    Direct Phone: 301/315-9635
Suite 207                                          Phone: 301/315-9631
Rockville, MD  20850                                 Fax: 301/315-8285
----------------------------------------------------------------------
  Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>