docbook-apps

  • 1.  Re: [docbook-apps] table vertical spans and page breaks

    Posted 11-12-2008 20:00
    Hi,
    This is very interesting. I did not know that keep-together is not a
    property that acts on fo:table-cell, but that is indeed what the spec says.
    My experience has been that in both XEP and Antenna House, putting that
    property on fo:table-cell will keep the cell together regardless of its
    spans or content (or lack thereof).

    The spec does say that the keep-together property is inherited, so the
    fo:block that DocBook XSL wraps the cell content in will inherit the
    keep-together. So regardless of how many rows that cell spans, its actual
    content in the fo:block will be kept together. As you say, if that block
    doesn't fill the cell, there is nothing in the spec that prevents the cell
    itself from being broken below the block.

    Do you know if the following solution works in FOP 0.95?

    > The only solution, to my knowledge, to properly handle this is to set
    > keep-together on every row spanned by the cell, plus keep-with-next on
    > every row but the last one.

    This might be feasible in the DocBook XSL stylesheet because of the way it
    keeps track of vertical spans when processing rows.

    Bob Stayton
    Sagehill Enterprises
    bobs@sagehill.net


    ----- Original Message -----
    From: "Vincent Hennebert" <vhennebert@gmail.com>
    To: <docbook-apps@lists.oasis-open.org>
    Sent: Wednesday, November 12, 2008 3:23 AM
    Subject: Re: [docbook-apps] table vertical spans and page breaks


    > Hi,
    >
    > Bob Stayton wrote:
    >> OK, I checked this out, and it seems that FOP 0.95 knows how to keep an
    >> ordinary table cell together, but it does not know how to keep a cell
    >> together if it spans down to additional rows. That should probably be
    >> reported as a bug on FOP, because it should work for spanned cells too.
    >
    > I think FOP is correct with respect to the XSL-FO specification. This is
    > a corner case here, that’s not well described by the spec and does
    > certainly not match common sense.
    >
    > Actually the keep-together property does not apply to the fo:table-cell
    > element. It does apply to the block children of a table cell, though,
    > and that should work properly in FOP even with row-spanning cells.
    > However, if the cell is not filled with its content (if there is some
    > empty space left at the bottom of the cell), then it’s perfectly
    > acceptable to break there:
    > _______________________
    > | | |
    > | cell 1.1 | content of | \
    > |__________| a row- | |_ This will remain
    > | | spanning | | together on a page
    > | cell 2.1 | cell | /
    > |__________| |
    >
    > <----- Page break ------>
    > __________
    > | | |
    > | cell 3.1 | |
    > |__________|____________|
    >
    >
    > The only solution, to my knowledge, to properly handle this is to set
    > keep-together on every row spanned by the cell, plus keep-with-next on
    > every row but the last one.
    >
    > It might also be possible to put a block with keep-together inside the
    > spanning cell, and as its children as many blocks containing
    > non-breaking spaces as necessary to fill the cell:
    > <fo:block keep-together.within-column="always">
    > <fo:block> </fo:block>
    > <fo:block> </fo:block>
    > <fo:block> </fo:block>
    > ...
    > </fo:block>
    > But obviously the number of blocks will depend on the content of the
    > other cells, which will make the thing tricky to implement.
    >
    > <snip/>
    >
    > Vincent
    >
    > ---------------------------------------------------------------------
    > To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
    > For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org
    >
    >
    >




  • 2.  Re: [docbook-apps] table vertical spans and page breaks

    Posted 11-13-2008 10:12
    Hi Bob,

    Bob Stayton wrote:
    > Hi,
    > This is very interesting. I did not know that keep-together is not a
    > property that acts on fo:table-cell, but that is indeed what the spec
    > says. My experience has been that in both XEP and Antenna House, putting
    > that property on fo:table-cell will keep the cell together regardless of
    > its spans or content (or lack thereof).

    I guess a similar extension could be implemented in FOP. If anyone wants
    to file a RFE:
    https://issues.apache.org/bugzilla/enter_bug.cgi?product=Fop
    ;-)


    > The spec does say that the keep-together property is inherited, so the
    > fo:block that DocBook XSL wraps the cell content in will inherit the
    > keep-together. So regardless of how many rows that cell spans, its
    > actual content in the fo:block will be kept together. As you say, if
    > that block doesn't fill the cell, there is nothing in the spec that
    > prevents the cell itself from being broken below the block.
    >
    > Do you know if the following solution works in FOP 0.95?

    Yes it does. Keeps and breaks should now be fully supported on every
    table element to which they apply (except the general limitation that
    only the "always" value is supported for keeps).


    >> The only solution, to my knowledge, to properly handle this is to set
    >> keep-together on every row spanned by the cell, plus keep-with-next on
    >> every row but the last one.
    >
    > This might be feasible in the DocBook XSL stylesheet because of the way
    > it keeps track of vertical spans when processing rows.

    That would be great!


    Thanks,
    Vincent