xsl-list
[Top] [All Lists]

Re: Missing 'width' attribute, CALS limitation?

2002-11-12 14:41:46
At 2002-11-12 22:10 +0100, Gustaf Liljegren wrote:
At 13:00 2002-11-12 -0500, you wrote:
Thanks Ken and thanks Eliot,

I'll try to to explain myself better now. The function Ken mentioned is
useful, but it doesn't solve the problem. I still think my first assumption
is right.

>You can mix absolute widths (i.e. column-width="5cm") with proportional
>widths (i.e. column-width="proportional-column-width( number-of-units )")
>and the formatter will prorate the remaining width of the table for
>proportional specifications after removing any absolute values.

How do you know how wide one column is without a total number to divide and
subtract from?

The formatter does all that for you. You just use arbitrary numbers and the formatter sums them and prorates the proportions accordingly.

Adding absolute values is easy, but how do you know how much
is left for the proportional columns when you subtract the absolute widths
from the total?

The formatter worries about it, not the stylesheet writer.

If you know you have three columns and the first is twice as wide as each of the other two, then use the values "2, 1, 1" ... the formatter does the prorating.

You can allow the numbers to sum to any value ... it doesn't matter.

In fact, some people when using CALS like to use p-c-w() function with the units summing to 100, thereby getting percentages even though CALS doesn't support percentages.

Not all tables need the full width of fo:region-body, and some tables may
perhaps need more than the full width.

You cannot adjust the page geometry based on content. However, I demonstrate in our freely downloadable XSL-FO resource titled "PSMI (Page Sequence Master Interleave) that it is possible to selectively incorporate page geometries when you know at stylesheet time you need something different. I even use the desire to have a landscaped table in the middle of a portrait page sequence as the example.

There's no way to know the total
unless you specify it by hand. The value must be carried by the XML
document, then used by the stylesheet.

There is table-layout="auto", but as Eliot said, you cannot have this and also use the p-c-w() function. To use p-c-w() you must use table-layout="fixed".

Here's my reading of proportional-column-width function (5.10.4):

"The proportional-column-width function returns N units of proportional
measure where N is the argument given to this function."

You specify 5 if you have proportional columns widths like 2*, 2* and 1*.
There may be absolute columns between, like in 2*, 2.54cm, 2*, 1in, 1*.

"The column widths are first determined ignoring the proportional measures."

I think they mean the proportional columns widths are not counted in the
first calculation, when you add absolute widths.

Yes.

"The difference between the table-width and the sum of the column widths is
the available proportional width."

Where does the table-width come from?

You are correct, to use p-c-w() you do have to specify this in your stylesheet. If you can assume it, great, but if you cannot assume it, then you will need some indication in your XML.

"One unit of proportional measure is the available proportional width
divided by the sum of the proportional factors." [...]

If there (coincidentally) was 5 inches left, the above set of proportial
columns would be 2, 2 and 1 inch.

Correct.

Here's my assumption again: "to calculate mixed column widths (proportional
and absolute), you need the total width of a table?" Am I wrong this time
too? :-)

You are not wrong ... but I'm not sure where your problem is.

You are writing a layout specification for an XML instance. As the stylesheet writer, you are in charge of the layout of the table. XSL-FO 1.0 requires you to specify the table width in order to use p-c-w(), or if you can accept the formatter automatically laying out the table (as is what happens with HTML browsers), then you don't use p-c-w().

If you are only worried about the page dimensions, then you can use a percentage of the ancestral reference area by saying something along the lnies of <table width="80%">.

I'm not sure where you feel you are being let down by the XSL-FO 1.0 design. How could the formatter know how wide a table is from XML since XML doesn't infer any presentational semantics whatsoever? I think the closest is table-layout="auto" as in HTML, which happens to be the XSL-FO table layout default.

I hope this helps.

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


--
Upcoming hands-on in-depth XSLT/XPath and/or XSL-FO:
-                             North America:  Feb 3 - Feb 7,2003

G. Ken Holman               mailto:gkholman(_at_)CraneSoftwrights(_dot_)com
Crane Softwrights Ltd.        http://www.CraneSoftwrights.com/s/
Box 266, Kars, Ontario CANADA K0A-2E0  +1(613)489-0999 (F:-0995)
ISBN 0-13-065196-6                     Definitive XSLT and XPath
ISBN 0-13-140374-5                             Definitive XSL-FO
ISBN 1-894049-08-X Practical Transformation Using XSLT and XPath
ISBN 1-894049-10-1             Practical Formatting Using XSL-FO
Next conference training:                    2002-12-08,03-03,06


XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



<Prev in Thread] Current Thread [Next in Thread>