xsl-list
[Top] [All Lists]

Re: [xsl] 'space-after' combined with 'break-after="page"' generates blank pages

2013-06-28 12:58:56
At 2013-06-28 06:26 -0700, Nancy wrote:
I'm having a problem (using XSL 2.0) with a table following a figure.

I think I know what is going on by looking at your excerpt, thank you for including the detail that you did.

I have the XSL mapped so that the figure is set in an <fo:block> with
space-after="6pt".

Then, the table is set to start with a page break.

However, I'm ending up with an extra page break after the figure,
before the table's page break, thereby creating a blank page in the
middle of the document.  The code in the [topic].fo file is as follows
(first chunk is the figure, second chunk is the beginning of the
table):

I believe your culprit is a combination of this:

<fo:block break-after="page"/>
<fo:block xmlns:rx="http://www.renderx.com/XSL/Extensions"; span="all"
start-indent="0pt">
<fo:block/>

... and in your table cell, this:

<fo:block font-size="10pt" font-style="normal" font-weight="bold"
keep-with-next.within-column="always"

So, what is happening is that the figure is put on the page, the block with the break after is put on the same page, the break starts a new page, and you then have some blocks (without visible content) at the start of that new page.

Now you get to the table. Your cell content requires to be kept in the same page column as the content that follows. I'm supposing that the combination of that block and the following block-level construct does not fit on a page.

So, since the content that does not fit is being put on a page that is not empty (though happens to be visibly empty, it isn't block-level empty), the formatter starts a new page and tries to put the content on the new page. If it doesn't fit there, then the "keep" is broken at that point and the table flows. But it is too late for the formatter to go back to the non-empty page where the table was first asked to fit.

I don't like that behaviour, but I actually highlight this in my training class because I've been burned by it before, which is why I recognized it in your post. If you download the free "try and buy" copy of my XSL-FO book, you'll see a diagram of this behaviour on page 326 with the text on the preceding and following pages:

  http://CraneSoftwrights.com/training/#pfux

I had thought that 'space-after' created a space after the object on
the same page, but it's as though the space-after is going on to the
next page, and then the table starts on the page after that.
Otherwise, it seems as if the break-after="page" is putting in a page
break even though the new table object was already creating a page
break.

That's a red herring ... I'm confident it is the keep that is biting you.

Both Antenna House and RenderX render it the same way, so I'm assuming
it's my coding rather than any processor problem.

Correct.

What it is I'm missing here?

The behaviour of keeps and what happens when they break.

I hope this helps.

. . . . . . . . . Ken

--
Contact us for world-wide XML consulting and instructor-led training |
Free 5-hour lecture: http://www.CraneSoftwrights.com/links/udemy.htm |
Crane Softwrights Ltd.            http://www.CraneSoftwrights.com/s/ |
G. Ken Holman                   mailto:gkholman(_at_)CraneSoftwrights(_dot_)com 
|
Google+ profile: https://plus.google.com/116832879756988317389/about |
Legal business disclaimers:    http://www.CraneSoftwrights.com/legal |


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>