Re: [xsl] Contents overflow in table cell ?

Subject: Re: [xsl] Contents overflow in table cell ?
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Wed, 17 Dec 2003 08:11:23 -0500
At 2003-12-17 10:08 +0000, Jonny Pony wrote:
My problem is that I got entries that overflow the regions of the columns in the table and therefore overlap the other column.

That sounds like a bug in software not a problem with XSL-FO ... text in a table cell is in a block so is supposed to wrap and create new lines when it reaches the end-edge of the table cell. You don't mention any use of properties to prevent wrapping, so that would point to a problem in the implementation you've chosen to use.

The substring-function is not suitable, because it cannot really control the length of the contents (fonts and characters have a different width, so limiting the string to xx-characters makes no sense).

Correct, at transformation time there is no feedback on the length of formatted information.

Is there a way of cuttting of the text at the end of the cell?

Yes: force the text to a single line instead of the default wrapping at the end of a table cell, then place that text inside of a block container whose overflow property hides anything that goes beyond the container's edges. For example:

    <block>Example with a lot of
    text that is specified to wrap in
    order to illustrate behaviour</block>
    <block-container overflow="hidden">
      <block white-space="nowrap">Example with a lot of
      text that is specified not to wrap in order to
      illustrate clipping</block>

Is there a way of cuttting of the text after xx-cm?


Is there a better approach?

Find a processor that works properly?

I hope this helps.

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

North America (Washington, DC): 3-day XSLT/2-day XSL-FO 2004-02-09
Instructor-led on-site corporate, government & user group training
for XSLT and XSL-FO world-wide:  please contact us for the details

G. Ken Holman                 mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
Crane Softwrights Ltd.
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-11-X               Practical Formatting Using XSL-FO
Member of the XML Guild of Practitioners:
Male Breast Cancer Awareness

XSL-List info and archive:

Current Thread