This is the mail archive of the docbook-apps@lists.oasis-open.org mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [docbook-apps] force pagebreaks in a glossary


I'm assuming you are using FOP, and that the <?pagebreak?> processing
instruction outputs an emtpy fo:block with a break-before="page"  property,
right?

The reason this doesn't work in a glossary is because the default formatting
for a glossary uses an fo:list-block, with a fo:list-item for each entry.
XSL-FO does not support putting an fo:block as a sibling of fo:list-item, so
it is being ignored (it should be flagged as an error, actually).  You will
have the same problem if you try to use it between DocBook listitem elements
in a list.

The simplest solution would be to set $glossary.as.block to 1, then the
output would be a sequence of fo:block elements instead of fo:list-items in
a fo:list-block container.  Then your empty fo:block would fit in between
entries.

But if you don't like how that looks, you could make the template that
processes the processing instruction context sensitive, and change what it
outputs.  For a glossary formatted as a list, you would need to output an
empty fo:list-item, as follows:

<xsl:choose>
  <xsl:when test="parent::glossary" and $glossary.as.blocks = 0">
    <fo:list-item break-before="page">
      <fo:list-item-label><fo:block/></fo:list-item-label>
      <fo:list-item-body><fo:block/></fo:list-item-body>
    </fo:list-item>
  </xsl:when>
  <xsl:otherwise>
    <fo:block break-before="page"/>
  </xsl:otherwise>
</xsl:choose>

You'll have to experiment a bit to see if FOP will break on a fo:list-item,
or if you have to put that property on one of its descendents.  You also may
want to extend this to other list elements.

Bob Stayton
Sagehill Enterprises
DocBook Consulting
bobs@sagehill.net


----- Original Message ----- 
From: "Tom Peters" <tpeters@xs4all.nl>
To: "docbook-apps" <docbook-apps@lists.oasis-open.org>
Sent: Thursday, May 05, 2005 3:47 PM
Subject: [docbook-apps] force pagebreaks in a glossary


> At various places in my book I force page breaks with:
> <?pagebreak?>
> as directive for xsltproc.
> However, this does not work between or within my <glossentry> list:
> frequently I get a <glossterm> at the bottom of a page that I can not
> force on the next page together with its <glossdef> part.
>
> What can I do about it?
> --
>
#>!$!%(@^%#%*(&(#@#*$^@^$##*#@&(%)@**$!(&!^(#((#&%!)%*@)(&$($$%(@#)&*!^$)^@*
^@)
>
> Tom Peters
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
> For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org
>
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]