Hi,
In a case involving mostly empty nested lists and tables, I encountered
an annoying issue. I've been able to isolate the behaviour to the
following case where a list item contains a table that contains a
further nested table:
[empty list item label] [empty list item]
/------------------------------------------------\
| | /----------------------------\ |
| where am I? | | | where am I? | |
| | \----------------------------/ |
\------------------------------------------------/
Attached is an example XSL-FO file containing two versions of this case.
The first one illustrates the error, which occurs whenever the
fo:list-item-body with the nested table contains no text whatsoever.
This produces an empty PDF structure, without any text, as follows:
[empty list item label] [empty list item]
/------------------------------------------------\
| | /----------------------------\ |
| | | | | |
| | \----------------------------/ |
\------------------------------------------------/
I noticed that the problem can be avoided by providing some non-breaking
whitespace in this fo:list-item-body containing the first nested table
(the fo:block containing fo:[EMAIL PROTECTED]'goodtable1'] in the example
XSL-FO). Now all text content gets rendered, BUT at the cost of an extra
newline, because of the whitespace preceding the fo:table block structure.
[empty list item label] [empty list item]
/------------------------------------------------\
| | /----------------------------\ |
| where am I? | | | where am I? | |
| | \----------------------------/ |
\------------------------------------------------/
I can live with such a workaround (explicitly inserting whitespace in
otherwise empty blocks), but not with the extra newline this creates. I
tried with other characters, like (Unicode ZERO WIDTH NO-BREAK SPACE),
but this yields the empty table again... Does anyone see a solution to
make this workaround actually work?
Kind regards and thanks in advance,
Ron Van den Branden
<?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 page-width="210mm" page-height="297mm"
margin="1.5cm" master-name="simple">
<fo:region-body/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="simple">
<fo:flow flow-name="xsl-region-body">
<!-- in following empty list structure containing nested tables, no text content is rendered whatsoever due to the empty list item -->
<fo:list-block provisional-distance-between-starts="50pt"
provisional-label-separation="10pt"
start-indent="from-parent(start-indent) + 5pt">
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block>Â </fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>
<fo:table id="badtable1" inline-progression-dimension="160mm"
table-layout="fixed" width="100%">
<fo:table-body>
<fo:table-row>
<fo:table-cell
border-collapse="collapse"
text-align="left" start-indent="0"
border="solid 1px" padding="0.5em">
<fo:block>where am I?</fo:block>
</fo:table-cell>
<fo:table-cell
border-collapse="collapse"
text-align="left" start-indent="0"
border="solid 1px" padding="0.5em">
<fo:block>
<fo:table id="badtable2"
inline-progression-dimension="160mm"
table-layout="fixed"
width="100%">
<fo:table-body>
<fo:table-row>
<fo:table-cell
border-collapse="collapse"
text-align="left"
start-indent="0"
border="solid 1px"
padding="0.5em">
<fo:block/>
</fo:table-cell>
<fo:table-cell
border-collapse="collapse"
text-align="left"
start-indent="0"
border="solid 1px"
padding="0.5em">
<fo:block>where am I?</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</fo:block>
</fo:list-item-body>
</fo:list-item>
</fo:list-block>
<!-- in following empty list structure containing nested tables, inserting a zero-width space inside the empty list item forces the text content to be rendered BUT introduces a non-desirable newline...-->
<fo:list-block provisional-distance-between-starts="50pt"
provisional-label-separation="10pt"
start-indent="from-parent(start-indent) + 5pt">
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block>Â </fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block><!-- here it is--> ​
<fo:table id="goodtable1" inline-progression-dimension="160mm"
table-layout="fixed" width="100%">
<fo:table-body>
<fo:table-row>
<fo:table-cell
border-collapse="collapse"
text-align="left" start-indent="0"
border="solid 1px" padding="0.5em">
<fo:block>where am I?</fo:block>
</fo:table-cell>
<fo:table-cell
border-collapse="collapse"
text-align="left" start-indent="0"
border="solid 1px" padding="0.5em">
<fo:block>
<fo:table id="goodtable2"
inline-progression-dimension="160mm"
table-layout="fixed"
width="100%">
<fo:table-body>
<fo:table-row>
<fo:table-cell
border-collapse="collapse"
text-align="left"
start-indent="0"
border="solid 1px"
padding="0.5em">
<fo:block/>
</fo:table-cell>
<fo:table-cell
border-collapse="collapse"
text-align="left"
start-indent="0"
border="solid 1px"
padding="0.5em">
<fo:block>where am I?</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</fo:block>
</fo:list-item-body>
</fo:list-item>
</fo:list-block>
</fo:flow>
</fo:page-sequence>
</fo:root>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]