This is the mail archive of the
docbook-apps@lists.oasis-open.org
mailing list .
RE: page break
- From: Jeff Beal <jeff dot beal at ansys dot com>
- To: '~ion~' <vnhu38f93 at subdimension dot com>,docbook-apps <docbook-apps at lists dot oasis-open dot org>
- Date: Mon, 16 Dec 2002 16:09:38 -0500
- Subject: RE: DOCBOOK-APPS: page break
Getting a processing instruction to throw an attribute into the next
generated fo:block is impossible. In order to get the FO code that you
want, you would have to customize the template for every block-generating
element before which you may want to generate a page break, for example:
<xsl:template match="figure">
<fo:block>
<xsl:if test="processing-instruction('fo-page-break')">
<xsl:attribute name="break-before">page</xsl:attribute>
</xsl:if>
<!-- Remainder of template copied from distribution.
apply-imports won't give you what you want -->
</fo:block>
</xsl:template>
But, I am quite certain that an empty fo:block will not generate any space.
If it does, you can probably fix it by specifically setting certain
attributes to zero:
- padding
- space-before
- space-after
- font-size
- height
Jeff Beal
-----Original Message-----
From: ~ion~ [mailto:vnhu38f93@subdimension.com]
Sent: Monday, December 16, 2002 4:00 PM
To: docbook-apps
Subject: DOCBOOK-APPS: page break
I wanted this output in the XSL-FO:
<fo:block break-before="page">
blah blah blah
</fo:block>
But I didn't know how to put this into my customisation layer so
I tried:
<!-- page-break support -->
<xsl:template match="processing-instruction('fo-page-break')">
<fo:block break-before="page"/>
</xsl:template>
And then inserted
<?fo-page-break?>
Into the DocBook document where a page break was required.
I don't like this because it is dirty and produces:
<fo:block break-before="page"/>
<fo:block>
blah blah blah
</fo:block>
Which is sub-optimal because ideally I think the page break should
be in the fo block that wraps the text that should appear on a new
page. <-- Does this reasoning make sense or does it not matter?
Is it OK to do this albeit quite dirty?
Can anyone think of any side-effects that might occur?
~io~