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


On Thu, 5 May 2005, Bob Stayton wrote:

Thanx for your suggestions;

> I'm assuming you are using FOP,

Yes

> and that the <?pagebreak?> processing
> instruction outputs an emtpy fo:block with a break-before="page"  property,
> right?

I wouldn't know.  Automatically generated .fo files are unreadable (at
least by me).


> 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.

Exactly what do you mean with "set $glossary.as.block to 1", and where
should I do that?  I ask because this is what I tried and it does not make
a difference:

xsltproc -o Glos.fo --stringparam paper.type A4 --param simplesect.in.toc
0 --param glossary.as.block 1 printglos.xsl Glos.tmp
fop Glos.fo Glos.pdf


> 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>

When I put the code you provided above in a pre-processing .xsl (which
otherwise automatically adds an <indexterm> stanza after each <glossterm>)
and call it with this command:

xsltproc -o Glos.tmp --param glossary.as.block 0 add-indexterms-glos.xsl
Glos.xml

Then I get error messages like these:

add-indexterms-glos.xsl:43: parser error : Specification mandate value for
attribute and  <xsl:when test="parent::glossary" and $glossary.as.blocks =
0">

When I leave out the '$' before glossary.as.blocks, then I get the same
error message.

So where should I put that code and how should I provide
glossary.as.blocks ?

	Thanx for your interest,
--
#>!$!%(@^%#%*(&(#@#*$^@^$##*#@&(%)@**$!(&!^(#((#&%!)%*@)(&$($$%(@#)&*!^$)^@*^@)

	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


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