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

Re: block with keep-together.within-line="always"

Subject: Re: block with keep-together.within-line="always"
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Tue, 29 Apr 2008 22:31:54 -0400
Re:  block with keep-together.within-line="always"
At 2008-04-29 20:44 -0500, John Cavalieri wrote:
What should happen when a block with
keep-together.within-line="always" has text which is longer than one
line?

It goes off the end of the line because you asked it all to keep together.


Should the text wrap?

Nope.


For example the following flow:

<fo:flow flow-name="xsl-region-body" line-height="1.2em"
font-size="10pt" font-family="Times">
    <fo:block keep-together.within-line="always">
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Duis
ullamcorper fringilla ligula. Donec cursus, justo quis dapibus
vehicula, erat lacus faucibus mi, vel accumsan nibh arcu at sem. Sed
adipiscing gravida lectus. Suspendisse non nunc id justo consectetuer
aliquam. Vivamus.
     </fo:block>
</fo:flow>

The spec says keep-together.within-line "...imposes a keep-condition
.... with context consisting of the line-areas".  And since a
line-area, according to the spec, is a "special type of block-area" it
seems to me that the text should wrap.

It is a special type of block area because of its border and padding properties and how it is stacked and located by the starting edge of the content-rectangle. Nothing about the line's area constrains the text if you specify that the text must keep together.


As a result, in my stylesheets when I specify a keep condition on a block I always use keep-together.within-column= because just keep-together= implies keep-together.within-line=. Note that keep-together.within-column= is the same as keep-together.within-page= on a one-column page, so I rarely (if ever) use keep-together.within-page=.

The spec explicitly says in 4.8 "A keep-together condition is satisfied if all areas generated and returned by the formatting object are descendants of a single context-area." ... since the context area is a line, that implies no line breaks or wraps are allowed or it wouldn't then be satisfying the keep.

I hope this helps.

. . . . . . . . . . Ken

--
World-wide corporate, govt. & user group XML, XSL and UBL training
RSS feeds:     publicly-available developer resources and training
G. Ken Holman                 mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/s/
Box 266, Kars, Ontario CANADA K0A-2E0    +1(613)489-0999 (F:-0995)
Male Cancer Awareness Nov'07  http://www.CraneSoftwrights.com/s/bc
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

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.
Email
First Name
Last Name
Company
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.