This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Microsoft XML > October 2005 > XSL-FO: Howto keep heading and table on page?





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author XSL-FO: Howto keep heading and table on page?
Stefan Misch

2005-10-23, 6:20 pm

Hi,

I'm struggling with my first XSL:FO stylesheet (using FOP 0.20.5). How can I
enforce that a heading and all rows of a table are on the same page?

I tried the following:
- keep-with-next.within-page="always" on the fo:block for the heading
- keep-together.within-page="always" for fo:table (also tried this property
on fo:table-header and fo:tabel-body)

But it doesn't seem to work. If a table does not fit on the page some rows
are "printed" on the next page and the header is repeated.

I guess I'm missing something obvious.

TIA,
Stefan


Peter Flynn

2005-10-23, 6:20 pm

Stefan Misch wrote:

> Hi,
>
> I'm struggling with my first XSL:FO stylesheet (using FOP 0.20.5). How can
> I enforce that a heading and all rows of a table are on the same page?


Make the font or the linespacing smaller.

> I tried the following:
> - keep-with-next.within-page="always" on the fo:block for the heading
> - keep-together.within-page="always" for fo:table (also tried this
> property on fo:table-header and fo:tabel-body)
>
> But it doesn't seem to work. If a table does not fit on the page some rows
> are "printed" on the next page and the header is repeated.


I think that is correct for XSL:FO. What else should it do if the page is
too small or the font is too big or the linespacing is too big?

> I guess I'm missing something obvious.


If the table is too big, then the table is too big, period.
What do you want to happen?

///Peter

Stefan Misch

2005-10-23, 10:16 pm

Peter,

maybe I made the problem not quite clear.

Each table is prefixed with a normal text block which is the title for the
table (this is what I called a "heading" in my first post). On some pages
this title line is at the end of the page but the table is on the next page
even though the property "keep-with-next.within-page" is set to "always" for
the title line.

I also use this property for fo:table, fo:table-header and fo:table-body to
avoid the splitting of a table. But it has no effect, so that some rows of a
table will go to the end of a page instead of the whole table on the next
page together with the title line.

The tables are not big, just about 5-8 lines with 8pt font. Fiddling arround
with the font or linespacing may solve the problem for one page but
depending on the XML-data used for the XSL this will lead to problems on
other pages.

To me it seems that the "keep-with-next" property is ignored by FOP 0.20.5.
I also tried to enclose the whole fo:table in a fo:block but that didn't
help either.

Just to make it clear:

Problem 1: How to avoid page break between title line and table

Titel line for Table
======== page break
+------------------
| table
+-------------
| row 1
-------------


Problem 2: How to avoid page break between rows of a table

Titel line for Table

+------------------
| table-header
+-------------
| row 1
-------------
======== page break
+------------------
| table-header repeated
+-------------
| row 2
-------------



"Peter Flynn" <peter.nosp@m.silmaril.ie> schrieb im Newsbeitrag
news:3s26niFlgbinU2@individual.net...
> Stefan Misch wrote:
>
>
> Make the font or the linespacing smaller.
>
>
> I think that is correct for XSL:FO. What else should it do if the page is
> too small or the font is too big or the linespacing is too big?
>
>
> If the table is too big, then the table is too big, period.
> What do you want to happen?
>
> ///Peter
>



olympus_mons@gmx.de

2005-10-24, 6:34 pm

FYI:

The problem is the Apache FOP 0.20.5 processor. I tried the same
stylesheet with a W3C conformant processor and the page layout is now
done correct.

Stefan

Peter Flynn

2005-10-24, 6:34 pm

Stefan Misch wrote:

> Peter,
>
> maybe I made the problem not quite clear.
>
> Each table is prefixed with a normal text block which is the title for the
> table (this is what I called a "heading" in my first post). On some pages
> this title line is at the end of the page but the table is on the next
> page even though the property "keep-with-next.within-page" is set to
> "always" for the title line.


Apologies for misunderstanding you. I think this is best answered on
the XSL List (hosted at www.mulberrytech.com).

///Peter

Stefan Misch

2005-10-25, 6:42 pm

No problem!

Thanks for pointing me to the XSL list.

Stefan


"Peter Flynn" <peter.nosp@m.silmaril.ie> schrieb im Newsbeitrag
news:3s52drFm5n74U2@individual.net...
> Stefan Misch wrote:
>
>
> Apologies for misunderstanding you. I think this is best answered on
> the XSL List (hosted at www.mulberrytech.com).
>
> ///Peter
>



Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews