FOP 0.95: table-layout="fixed" and column-width unspecified

Here should go questions about transforming XML with XSLT and FOP.
tatra603
Posts: 83
Joined: Fri Sep 17, 2004 10:53 am
Location: Prague, the Czech Republic, Europe

FOP 0.95: table-layout="fixed" and column-width unspecified

Post by tatra603 »

Hello!

I received following warning from Apache FOP 0.95. It is strange for me, because I have defined column-width. Could You help me, please? My FO file is below.

Thank You in advance. Stepan

Code: Select all

L:\RunFiles\fop-0.95>fop -fo name0201.xml -pdf name01.pdf
21.10.2008 16:20:29 org.apache.fop.fo.flow.table.TableColumn bind
WARNING: table-layout="fixed" and column-width unspecified => falling back to pr
oportional-column-width(1)
21.10.2008 16:20:29 org.apache.fop.fo.flow.table.TableColumn bind
WARNING: table-layout="fixed" and column-width unspecified => falling back to pr
oportional-column-width(1)

Code: Select all


<?xml version="1.0" encoding="UTF-8"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
<fo:simple-page-master margin="2cm" page-width="21.0cm" page-height="29.7cm" master-name="A4-portrait">
<fo:region-body />
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence initial-page-number="1" master-reference="A4-portrait" id="1">
<fo:flow flow-name="xsl-region-body">
<fo:table width="150mm" table-layout="fixed">
<fo:table-column width="50mm" />
<fo:table-column width="100mm" />
<fo:table-body>
<fo:table-row>
<fo:table-cell>
<fo:block>a1</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block>b1</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell>
<fo:block>a2</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block>b2</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</fo:flow>
</fo:page-sequence>
</fo:root>
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: FOP 0.95: table-layout="fixed" and column-width unspecified

Post by sorin_ristache »

Hello,

Apache FOP (the built-in FO engine of Oxygen) requires the attribute column-width together with the width one, that is something like:

Code: Select all

    <fo:table-column width="50mm" column-width="20mm"/>
<fo:table-column width="100mm" column-width="30mm"/>
Adding the column-width attribute fixes the Apache FOP warning.


Regards,
Sorin
tatra603
Posts: 83
Joined: Fri Sep 17, 2004 10:53 am
Location: Prague, the Czech Republic, Europe

Re: FOP 0.95: table-layout="fixed" and column-width unspecified

Post by tatra603 »

Hello,

thank You for the answer. But what is the difference between column-width and width attributes of fo:table-column element? You have set different values to them. Does it not mind?

Stepan
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: FOP 0.95: table-layout="fixed" and column-width unspecified

Post by sorin_ristache »

Hello,

In fact if you do not use automatic table layout then you must specify the column-width attribute as required by the specification: The "column-width" property must be specified for every column, unless the automatic table layout is used. The width attribute is not reported as error by FOP but I think it is ignored in this case. The required attribute for fo:table-column elements is column-width not width.


Regards,
Sorin
Post Reply