[xsl] Widows and orphans in XSL-FO

Subject: [xsl] Widows and orphans in XSL-FO
From: "Mark Wilson" <mark@xxxxxxxxxxxx>
Date: Fri, 30 Oct 2009 11:19:34 -0700
Hello all,
I am compiling a journal index. The output is generated via XSLT and XSL-FO. I have been looking for a way to deal with widows and orphans in XSL-FO, but all of the information I have found seems to be focused on breaks *within* an <fo:block>rather than *between* different<fo:block>s. My problem is that I only want to end a page if the processor has started rendering (or has completed rendering), a specific <fo:block>, one containing the content from an <Article> element. Is there a mechanism for forcing a page to end with, or within, a specific <fo:block>type?


The index itself may be seen at http://www.knihtisk.org/library/specialist/index.htm.

Thanks,
Mark

Pictures explain better than words. As you might imagine, the actual XSL-FO style sheet is quite complex. Thus, rather than supplying the style sheet itself, the seven possible problem configurations are shown below. Each of the five elements is rendered in its own <fo:block>:

<Heading> page 1
<Article> page 2

<Heading> page 1
<SubDiv1> page 2

<Heading> page 1
<SubDiv1> page 1
<Article>    page 2

<Heading> page 1
<SubDiv1> page 1
<SubDiv2> page 2

<Heading> page 1
<SubDiv1> page 1
<SubDiv2> page 1
<Article>    page 2

<Heading> page 1
<SubDiv1> page 1
<SubDiv2> page 1
<SubDiv3> Page 2

<Heading> page 1
<SubDiv1> page 1
<SubDiv2> page 1
<SubDiv3> page 1
<Article>    page 2

Current Thread