Re: Need better understanding of keep-with-next.within-column

At 2011-05-31 08:31 -0500, Mario Madunic wrote:
>I'm trying to get a better understanding of 
>keep-with-next.within-column when it pertains to a table header and 
>the minimum number of rows following it before pushing it to the 
>next column. What is confusing me is the term strength when it comes 
>to using an integer value for keep-with-next.within-column.

Such values are sole for comparison to other such values.  The values 
have no relationship to formatting objects per se.

When there are no other formatting objects using keep strength in 
play, then the integer value of the keep strength is irrelevant.

Consider, however, when there are three keep strengths in play:

   <object-2 keep-*="2">
     <stuff-2>
     </stuff-2>
     <object-3 keep-*="3">
       <stuff-3>
       </stuff-3>
     </object-3>
     <stuff-2>
     </stuff-2>
     <object-1 keep-*="1">
        <stuff-1>
        </stuff-1>
     </object-1>
     <stuff-2>
     </stuff-2>
   </object-2>

So ... whatever <object-2> is, say it doesn't fit in the existing 
context.  It then moves to the next context.  But what if it doesn't 
then fit in the second context?  So it "breaks".  It is breaking at a 
keep-strength of "2", which means any descendent constructs at a 
strength of "2" or less also break.  Which means that the processor 
doesn't even bother checking if <object-1> fits or not, because it is 
already considered broken.  However, <object-3> has a higher 
keep-strength, so it is still in play.    Thus, the formatter will 
continue to make sure <object-3> fits in context.  It may or may not 
break, but if it doesn't fit, it will attempt to keep it together in 
the next context.

Personally, I've only ever used keep-strength for the keep-together 
property and not for the keep-with-next or keep-with-previous.  I 
should think the same principles apply for all.

In my experience, I've only seen the Antenna House formatter support 
numeric keep strength values.  None of the other formatters I use 
recognize relative strength ... though the ones I've used have all 
supported "always" or mapped any number value to "always".

>I'd like to push the table header to the next column if there are 
>only 2 or less following table rows. And reading the spec it seems 
>if I use an integer value it is defined as strength and not a number 
>of rows or am I reading the spec wrong. Can I define a number of rows?

Nope.

But I don't think you can get what you want with XSL-FO.  Keeps will 
help you prevent the first row of a multy-row table from being 
orphaned on the page by using a keep-with-next="always" (thus 
dragging it to the next page if the second row must be put on the second page).

But not the other way around.  You can't "push" a table to the next 
column if it has two rows or fewer.  Those rows fit on the current 
column, so you'll get them on the current column.

I hope this helps your understanding of the way things work.

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

--
Contact us for world-wide XML consulting & instructor-led training
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/f/
G. Ken Holman                 mailto:gkholman@CraneSoftwrights.com
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal

Received on Tuesday, 31 May 2011 14:39:08 UTC