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 Sat, 7 May 2005, Bob Stayton wrote:

> Hi Tom,
> I meant for you to put the code snippet inside the template that handles
> your processing instruction:
>
> <xsl:template match="processing-instruction('pagebreak')">
>   <xsl:choose>
>   ...
> </xsl:template>
>

My print.xsl now has:

<!-- Page orientation and layout -->
<xsl:template match="processing-instruction('pagebreak')">
  <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>
<!-- Used to be:
    <fo:block break-after="page"/>
-->
</xsl:template>


> Also, you will need to add a namespace declaration to your customization
> stylesheet for the fo: namespace.  You can do that at the top of the file as
> described here:
>
> http://www.sagehill.net/docbookxsl/CustomMethods.html#WriteCustomization

I derived my print.xsl from a template that came with Debian.  It has had
this at the head:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; version="1.1"
  xmlns:fo="http://www.w3.org/1999/XSL/Format";
>


> Hopefully this will work now.

Halas...

I execute this:

xsltproc -o GemBook.fo --stringparam paper.type A4 --param
simplesect.in.toc 0 --stringparam glossary.as.blocks 0 print.xsl
GemBook.tmp

The code in the print.xsl (see above) specifies break-before="page" now
(used to be break-after="page") and this now appears in the .fo for the
normal text, so the <xsl:choose> section is processed; but there are still
no pagebreaks in the glossary section.  This surprises me, even if the
condition is not met there should be an explicit <fo:block
break-after="page"/>.  Instead I get this in the .fo:

...
<fo:list-item space-before.optimum="1em" space-before.minimum="0.8em"
space-before.maximum="1.2em" id="Halfedelsteen"><fo:list-item-label
end-indent="label-end()"><fo:block>Half-edelsteen<fo:wrapper
id="id2541959"><!--Half-edelsteen--></fo:wrapper></fo:block></fo:list-item-label>
<fo:list-item-body start-indent="body-start()"><fo:block
space-before.optimum="1em" space-before.minimum="0.8em"
space-before.maximum="1.2em">
...

BTW, in the .fo file the whole glossary is on the same line as the last
page of the regular text.  In the fo version of regular text there are a
few hundred line breaks.


I insert the pagebreaks like this:

<glossary>
<title>Woordenlijst</title>
<glossentry id="abc">
...
</glossentry>
<?pagebreak?>
<glossentry id="xyz">
...
</glossentry>
</glossary>


Some more magic required?

--
#>!$!%(@^%#%*(&(#@#*$^@^$##*#@&(%)@**$!(&!^(#((#&%!)%*@)(&$($$%(@#)&*!^$)^@*^@)

	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]