W3C home > Mailing lists > Public > www-xsl-fo@w3.org > January 2009

keep-with.within-page not working as expected

From: <mark.gebhardt@kodak.com>
Date: Thu, 22 Jan 2009 14:57:15 -0500
To: www-xsl-fo@w3.org
Message-ID: <OFB17F75D0.3DBF4A28-ON85257546.006CF56F-85257546.006D9FB0@knotes.kodak.com>
New to FO, this is my understanding and problem:

the property keep-together.within-page="#" brings the block to the next 
area if it won't fit in current area.  However, if block won't fit in next 
area, the "keep" is suppose to be ignored, and the block flows from the 
last area and into the new area, not start in this new area. 

The sample below has 3 sections.  Section 2 is too big to fit on page one, 
following section 1.  So it should move to the next area (page 2). 
However, since section 2 is still too large to fit in this area, the keep 
should fail, and section 2 should begin on page 1 and carry over to page 
2. 

In short, I am trying to get each section to start at the top of a page, 
unless they are too large, then they should start immediately following 
the previous section (same page previous section ends).
(I am using antennaHouse formatterv4.3mr5 which is suppose to support 
numeric keep values.

help?
Mark

mySAMPLE.fo
<?xml version="1.0" encoding="UTF-8"?>
<fo:root xmlns:xdt="http://www.w3.org/2005/02/xpath-datatypes" xmlns:xs="
http://www.w3.org/2001/XMLSchema" xmlns:fo="
http://www.w3.org/1999/XSL/Format" xmlns:axf="
http://www.antennahouse.com/names/XSL/Extensions" xmlns:svg="
http://www.w3.org/2000/svg" xmlns:fn="
http://www.w3.org/2005/02/xpath-functions">
        <fo:layout-master-set>
                <fo:simple-page-master master-name="odd-PrefaceMaster" 
page-width="5.5in" page-height="2.5in" margin-top="0in" margin-bottom="0in
" margin-left="0in" margin-right="0in">
                        <fo:region-body region-name="body" margin-right="
..75in" margin-left=".375in" margin-top=".375in" margin-bottom=".375in"/>
                        <fo:region-before region-name="odd-before" extent
=".375in" padding-start=".25in" padding-end=".25in" display-align="after
"/>
                        <fo:region-after region-name="odd-after" extent="
..375in" padding-start=".25in" padding-end=".25in"/>
                        <fo:region-start region-name="odd-start" extent="
..5in" reference-orientation="270"/>
                        <fo:region-end region-name="odd-end" extent=".5in" 
reference-orientation="90" padding-before=".25in" display-align="center" 
background-color="#333333"/>
                </fo:simple-page-master>
                <fo:simple-page-master master-name="even-PrefaceMaster" 
page-width="5.5in" page-height="2.5in" margin-top="0in" margin-bottom="0in
" margin-left="0in" margin-right="0in">
                        <fo:region-body region-name="body" margin-right="
..375in" margin-left=".75in" margin-top=".375in" margin-bottom=".375in"/>
                        <fo:region-before region-name="even-before" extent
=".375in" padding-start=".25in" padding-end=".25in" display-align="after
"/>
                        <fo:region-after region-name="even-after" extent="
..375in" padding-start=".25in" padding-end=".25in"/>
                        <fo:region-start region-name="even-start" extent="
..5in" reference-orientation="270" padding-before=".25in" display-align="
center" background-color="#333333"/>
                        <fo:region-end region-name="even-end" extent=".5in
" reference-orientation="90"/>
                </fo:simple-page-master>
                <fo:page-sequence-master master-name="prefaceMaster">
                        <fo:repeatable-page-master-alternatives>
                                <fo:conditional-page-master-reference 
master-reference="odd-PrefaceMaster" odd-or-even="odd" page-position="rest
"/>
                                <fo:conditional-page-master-reference 
master-reference="even-PrefaceMaster" odd-or-even="even" page-position="
rest"/>
                        </fo:repeatable-page-master-alternatives>
                </fo:page-sequence-master>
        </fo:layout-master-set>
        <fo:page-sequence master-reference="prefaceMaster" 
initial-page-number="1" format="1" writing-mode="from-page-master-region()
" reference-orientation="from-page-master-region()">
                <fo:static-content flow-name="odd-before"/>
                <fo:static-content flow-name="even-before"/>
                <fo:static-content flow-name="odd-after">
                        <fo:block text-align-last="justify">
                                <fo:inline>footer line<fo:page-number/></
fo:inline>
                        </fo:block>
                </fo:static-content>
                <fo:static-content flow-name="even-after">
                        <fo:block text-align-last="justify">
                                <fo:inline><fo:page-number/>footer line</
fo:inline>
                        </fo:block>
                </fo:static-content>
                <fo:static-content flow-name="odd-start"/>
                <fo:static-content flow-name="even-start">
                        <fo:block text-align="start">
                                <fo:inline font-size="18pt" color="#FFFFFF
" background-color="#333333">ENGLISH</fo:inline>
                        </fo:block>
                </fo:static-content>
                <fo:static-content flow-name="even-end"/>
                <fo:static-content flow-name="odd-end">
                        <fo:block text-align="end">
                                <fo:inline text-align="end" font-size="
18pt" color="#FFFFFF" background-color="#333333">ENGLISH</fo:inline>
                        </fo:block>
                </fo:static-content>
                <fo:flow flow-name="body">
 
                        <fo:block keep-together.within-page="5">
                                <fo:block><fo:inline>SECTION ONE (small 
&lt; page)(start and end on page 1)</fo:inline></fo:block>
                                <fo:block><fo:inline>This is a sample 
paragragh.</fo:inline></fo:block>
                        </fo:block> 
 
                        <fo:block keep-together.within-page="5">
                                <fo:block keep-with-next.within-page="9"><
fo:inline>SECTION TWO (larger than 1 page)(should start on page 1 and flow 
to page 2 since it can't fit fully on page 2 )</fo:inline></fo:block>
                                <fo:block keep-with-next.within-page="9"><
fo:inline>This is a sample paragragh.</fo:inline></fo:block><fo:block 
keep-with-next.within-page="9"><fo:inline>This is a sample paragragh.</
fo:inline></fo:block><fo:block keep-with-next.within-page="9"><fo:inline>
This is a sample paragragh.</fo:inline></fo:block><fo:block 
keep-with-next.within-page="9"><fo:inline>This is a sample paragragh.</
fo:inline></fo:block><fo:block keep-with-next.within-page="9"><fo:inline>
This is a sample paragragh.</fo:inline></fo:block><fo:block 
keep-with-next.within-page="9"><fo:inline>This is a sample paragragh.</
fo:inline></fo:block><fo:block keep-with-next.within-page="9"><fo:inline>
This is a sample paragragh.</fo:inline></fo:block><fo:block 
keep-with-next.within-page="9"><fo:inline>This is a sample paragragh.</
fo:inline></fo:block><fo:block keep-with-next.within-page="9"><fo:inline>
This is a sample paragragh.</fo:inline></fo:block><fo:block 
keep-with-next.within-page="9"><fo:inline>This is a sample paragragh.</
fo:inline></fo:block>
                        </fo:block>

                        <fo:block keep-together.within-page="5">
                                <fo:block><fo:inline>SECTION THREE (large 
- fits 1 page)(should be page 3 all by itself)</fo:inline></fo:block>
                                <fo:block><fo:inline>This is a sample 
paragragh.</fo:inline></fo:block><fo:block><fo:inline>This is a sample 
paragragh.</fo:inline></fo:block><fo:block><fo:inline>This is a sample 
paragragh.</fo:inline></fo:block><fo:block><fo:inline>This is a sample 
paragragh.</fo:inline></fo:block><fo:block><fo:inline>This is a sample 
paragragh.</fo:inline></fo:block><fo:block><fo:inline>This is a sample 
paragragh.</fo:inline></fo:block><fo:block><fo:inline>This is a sample 
paragragh.</fo:inline></fo:block><fo:block><fo:inline>This is a sample 
paragragh.</fo:inline></fo:block><fo:block><fo:inline>This is a sample 
paragragh.</fo:inline></fo:block>
                        </fo:block>
 
                </fo:flow>
        </fo:page-sequence>
</fo:root>
Received on Friday, 23 January 2009 08:27:50 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 23 January 2009 08:27:51 GMT