Re: [xsl] Widows and orphans in XSL-FO

Subject: Re: [xsl] Widows and orphans in XSL-FO
From: "Mark Wilson" <mark@xxxxxxxxxxxx>
Date: Fri, 30 Oct 2009 18:49:25 -0700
Hi Ken,
That is close, but any of the red elements (including the top level ones) may be followed by a back element before one of the lower level red levels is encountered.

I think, though, you have given me the general idea. I work on it for awhile.


From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Sent: Friday, October 30, 2009 5:57 PM
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Subject: Re: [xsl] Widows and orphans in XSL-FO

At 2009-10-30 17:44 -0700, Mark Wilson wrote:
Sorry my original post was not clear enough. I have a short output PDF file that may show better what I mean, but I cannot send it to the list. A longer copy is on the web at:

That helps a lot.

Page 1 ends with "Kvapilova, Hana"

In a perfect world, it would have ended with the line above it, "New issues: Czech Republic. Jan/Feb 1996 p.23." which is an <Article> element and Kvapilova, Hana" ( a <SubDiv1> element), would have been pushed to the next page.

The rule I want to enforce is:
"A page may only end with one or more renditions of <Article> elements." (Visually: a page may only end with a black rendition, never a red rendition).

The bottom of page 3 shows how pages should end. There, a list of <Article> elements extends from the bottom of page 3 to the top of page 4

I did get a lead on "blind tables" with my Google search and am attempting to see if that will work for me. The "keep-" properties seems more in line with my needs than the "break-" properties, but I am not sure.

How about for your top-level entries (e.g. "Actors") you don't use a keep.

Then for their first-level children (i.e. starting with "-") and second-level grandchildren (i.e. starting with "- - ") use keep-with-next.within-column="always".

Then for the black lines, use keep-with-previous.within-column="always". This handles the two lines of the "Velehrad" entry.

That way you'll get no page breaks between your red and black lines. Nor will you get a break between *adjacent* red lines. If you don't want a break before "Strahovaska Madona" then add keep-with-previous.within-column="always" to the "- - " grandchildren.

Page breaks should put first-level children at the top of the column, except between the first child of a top-level entry.

I think that will get you real close and perhaps meet all of your requirements as I understand them.

I hope this helps.

. . . . . . . . . . . . . Ken

Upcoming:  hands-on XSLT, XQuery and XSL-FO Washington DC Nov 2009
Interested in other classes?
Crane Softwrights Ltd.
Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video
Video lesson:
Video overview:
G. Ken Holman                 mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
Male Cancer Awareness Nov'07
Legal business disclaimers:

Current Thread