Re: SV: Re: [xsl] fo spaces

Subject: Re: SV: Re: [xsl] fo spaces
From: Abel Braaksma <abel.online@xxxxxxxxx>
Date: Thu, 15 Mar 2007 13:47:47 +0100
Mati Hadi wrote:
My xsl-fo is look like this:

<?xml version="1.0" encoding="utf-8"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format";>
I want to solve such problem when there is just one
line in the last block that it deasn't hold in the
current page and goes alone to the next page.(it is
not beautiful), so why not to take the minimum value
instead of optimum one.
what are space-before/after.minimum/maximum useful
for?

You repeat your question. Please read my previous comments, it answers your question. The space-before/after are not meant for keeping widows and orphans. By default, two lines are kept together as widow/orphan. You can override this for any block-level element with the widow/orphan properties. The value is numeric and denotes the number of lines to keep. For more info I suggest you read up on chapter 9.2 "Widows and Orphans" of Ken Holman's book.


I tried your xsl-fo file, but it contained errors. After fixing them, it did not show what you seem to try to tell (i.e., nothing breaks on the page-end).

To test the widow/orphan, you can try the following xsl fo stylesheet. When processed, notice that, without widow/orphan control, two lines show on the next page (this is the default), but with widows="3", you will see three lines on the second page.

<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format";>
   <fo:layout-master-set>
       <fo:simple-page-master
           master-name="test-page-master" page-width="2in"
           page-height="1.5in">
           <fo:region-body margin="0.25in"/>
       </fo:simple-page-master>
   </fo:layout-master-set>
   <fo:page-sequence
       master-reference="test-page-master">
       <fo:flow flow-name="xsl-region-body">
           <fo:block widows="3">
               Neque porro quisquam est
               qui dolorem ipsum quia
               dolor sit amet, consectetur,
               adipisci velit...
           </fo:block>
       </fo:flow>
   </fo:page-sequence>
</fo:root>



-- Abel Braaksma

Current Thread