[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: XSL FO keep-together=int Implementation?

Subject: Re: XSL FO keep-together=int Implementation?
From: Alex Milowski <alexml@xxxxxxxxxxxx>
Date: Sun, 12 Jun 2005 20:12:02 -0700
fo keep together
On Jun 12, 2005, at 10:54 AM, J.Pietschmann wrote:

G. Ken Holman wrote:
Thank you for your extensive explanation. I was, however, after more
concrete advice.
Let's say I have a listing in a block which should be printed on the
next page if it fits it, possibly leaving a large space on the current
page, but which should just continue on the current page if it doesn't
fit completely on the next page. I believe it depends on the processor
whether this can be achieved.

In a constraint-based format description vocabulary like FO, you are going to have different output depending on certain algorithm choices. So, page fidelity between FO processors shouldn't be a expected. The major concern is whether they obey the constraints being specified.

Let's say the processor implements a penalty based algorithm similar to Knuth's paragraph filling (which is currently implemented in FOP dev
[*not* the latest FOP release, 0.20.5]). Lets also take a block which
will fill the remaining space on the current page, the next page and a
bit of the page after the next page, for a total of two page breaks.
If the processor decides to start the block on the next page, the block
still fits the next page and the page after the next, also for a total
of two page breaks. Which layout is choosen depends on which penalties
the implementor assigns to "normal" page breaks and to page breaks
caused by "eagerly shifting", and perhaps how much leaving space weights
in. It may be possible to put the block in question in another block
togehter with preceding content and a lower keep precedence for fine

Is this block floating somehow?

I've been mostly concerned with sequential block stacking where I want
the page breaks to occur to minimize odd spacing but to obey my
keep constraints.

If I remember the discussion of this when XSL FO was being developed,
the idea is that you have to iterate over the block sequence some number
of times to really do this nicely. A bad choice for break might cause
really bad things to happen to keeps constraints, floats, and/or cause odd spaces
on pages to obey the keeps.

One way out of this is to keep track of "bad placement" of blocks.
Beyond some threshold, you might re-place a subsequence of them to
try to achieve a better flow of areas.

However, I don't think this is portable, and the FO processor
might decide to start a new page anyway once it detects the block wont
fit completely onto the current page (as FOP 0.20.5 does).

I'm not sure what "portable" means here.

So the question remains: How do I achieve the layout described above
in a processor independent way, using keep precedence levels or
whatever, and without guessing in advance whether the content will fit
on a page (for assigning different keep precendences in pre-layout
stages or whatever)?

Are you asking for the XSL FO example that demonstrates the use case or the algorithm for the use case?

I've been anxious to find implementations of relative keep strength in order to improve the presentation of the annexes of my XSL-FO book, but I haven't seen any yet. I would have liked to help Alex by citing an implementation, but I didn't have anything to contribute to his question.

FOP HEAD is on the way of implementing this. There is still quite a bit to code, so don't hold your breath. A pre-alpha release is planned in two or three months.

Yes it is. I've been watching and playing every time I see a milestone achieved. It would really be good to ensure that keep-together=int isn't in conflict with all the good work happening on FOP.

-- Alex Milowski

"The excellence of grammar as a guide is proportional to the paucity of the
inflexions, i.e. to the degree of analysis effected by the language

Bertrand Russell in a footnote of Principles of Mathematics

Current Thread


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.