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: Re: [docbook-apps] Running heads question for XSL:FO


Seems like choosing the heading level to track in running headers or
footers should be a feature controlled by a parameter.  I'll see if I
can get that in the next release.

In the meantime, you could customize the template in fo/sections.xsl
that starts with:

<xsl:template match="section/title
                     |simplesect/title
                     |sect1/title
                     |sect2/title
                     |sect3/title
                     |sect4/title
                     |sect5/title"
              mode="titlepage.mode"
              priority="2">

You will see that it computes a variable named "level" that
contains the section level.  You could use that variable in
a choose statement to set the "marker" parameter used in
the call to the template named section.heading further down.

For example:

<xsl:variable name="marker">
  <xsl:choose>
    <xsl:when test="$level = 1">1</xsl:when>
    <xsl:otherwise>0</xsl:otherwise>
  </xsl:choose>
</xsl:variable>

Then call "section.heading" with the marker parameter set to that value:

<xsl:call-template name="section.heading">
  <xsl:with-param name="marker" select="$marker"/>
  etc.

If you look in the section.heading template in fo/sections.xsl,
you will see that the fo:marker output depends on the $marker
parameter, which is by default 1.  With your change, it will
only be 1 for level 1 sections.

Bob Stayton
Sagehill Enterprises
bobs@sagehill.net


----- Original Message ----- 
From: "Billard, Trish" <trish.billard@hp.com>
To: "Bob Stayton" <bobs@sagehill.net>; <docbook-apps@lists.oasis-open.org>
Sent: Tuesday, December 09, 2003 5:27 PM
Subject: RE: [docbook-apps] Running heads question for XSL:FO


Hi Bob,

  Thanks for your response! Actually, I have looked at your site, and I even
have your book on my wish list for Christmas.  : )
The information has been tremendously helpful!
  But here's my problem.  I've altered the header.content template such that
the "titleabbrev.markup" part is for $position = 'left', the draft.text part
is in the center, and the following for the right:

   <xsl:when test="($sequence = 'odd' or $sequence='even') and $position =
'right'">
     <fo:retrieve-marker retrieve-class-name="section.head.marker"
            retrieve-position="first-including-carryover"
            retrieve-boundary="page"/>
      </xsl:when>
(I'm pretty sure this is an exact copy from the example, except for the
$position value.)

My output pages are like this:

-- 1st page --
Chapter 1. My Chapter Title
Table of Contents
Sect1 Title
blah blah blah
Sect2Title
blah blah blah
Sect3Title
blah blah
first row of an informal table
-----------

-- 2nd page --
remaining rows of the informal table
Sect4title
blah blah blah
blah blah blah
-------------

The headers for the 2nd page are "My Chapter Title" on the left (good), and
"Sect4Title" on the right.
What I'd like to be able to get is the Sect1 Title.  That is, I want the
right running head to change only when a new Sect1 appears.
I'm not sure how to do this.  I can't set the retrieve-boundary to
page-sequence, because that's the beginning of the chapter.
Actually, I kind of expected the right side to be my Sect3Title, because the
"first-including-carryover" seemed to imply it would take whatever was being
carried over from the previous page. So I'm confused about what
"first-including-carryover" means.
Can what I'm asking be done?  Can you recommend a good FO reference site on
the web?

Thank you!


Trish Billard
trish.billard@hp.com
(408) 285-5462



-----Original Message-----
From: Bob Stayton [mailto:bobs@sagehill.net]
Sent: Saturday, December 06, 2003 1:23 AM
To: Billard, Trish; docbook-apps@lists.oasis-open.org
Subject: Re: [docbook-apps] Running heads question for XSL:FO


> ----- Original Message ----- 
> From: "Billard, Trish" <trish.billard@hp.com>
>  Now I'm getting my feet wet with XSL:FO and PDF output.  I'm using the
1.59.2 version > of the stylesheets, rendering using FOP 0.20.5

>  I've altered the header.content so that the chapter title is on the left
side of every page.
>  Now I want the right side of every page to contain the sect1 title, even
if the page itself
> only has the child sect2, sect3, etc. elements on it.
>  How can I do this in FO?  Has anyone tried this?

Hi Trish,
There is an annotated example that does just that in:

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

[modesty aside]
This is a perfect example of why
anyone who wants to customize the DocBook XSL stylesheets
should use my book "DocBook XSL: The Complete Guide"
(available at Amazon). If you can't afford to buy a copy,
you can read it in HTML at the above site.
[modesty restored]
Don't take my word for it. Norm says "Buy this book!"
http://norman.walsh.name/2003/07/08/buythisbook

Bob Stayton
Sagehill Enterprises
bobs@sagehill.net
http://www.sagehill.net






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