OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [docbook-apps] nonbreaking tables


The commercial XSL-FO processors such as XEP and Antenna House do a better
job of  handling tables across page breaks.  Assuming you can't afford one,
you could try Apache FOP, which is free but not quite complete.

The feature you are looking for is "keep".  Ideally you could place a
keep-together.within-column="always" property on the fo:table element and
that should work, except it isn't yet implemented in FOP.  The only keep
that works in the current FOP (0.20.5) is
keep-with-next.within-column="always" when used in fo:table-row.  In your
case, that could be used in every row to keep the table together.

The following customized template does that for all table rows:

<xsl:template match="row">
  <xsl:param name="spans"/>

  <fo:table-row>
    <xsl:attribute
name="keep-with-next.within-column">always</xsl:attribute>
    <xsl:call-template name="anchor"/>

    <xsl:apply-templates select="(entry|entrytbl)[1]">
      <xsl:with-param name="spans" select="$spans"/>
    </xsl:apply-templates>
  </fo:table-row>

  <xsl:if test="following-sibling::row">
    <xsl:variable name="nextspans">
      <xsl:apply-templates select="(entry|entrytbl)[1]" mode="span">
        <xsl:with-param name="spans" select="$spans"/>
      </xsl:apply-templates>
    </xsl:variable>

    <xsl:apply-templates select="following-sibling::row[1]">
      <xsl:with-param name="spans" select="$nextspans"/>
    </xsl:apply-templates>
  </xsl:if>
</xsl:template>

If you don't know how to customize the XSL stylesheets, see this reference:

http://www.sagehill.net/docbookxsl/CustomMethods.html

The only problem with this method is that it really only works with
informaltable. The title in a <table> element will get a keep-with-next as
well, but it won't work because the title is an fo:block and not part of the
table.  So you will end up with your table title on one page and the whole
table on the next page. You would have to put the title in the first row of
the informaltable and fudge the table rule lines to make it look like a
title instead of a table row.  But it won't be a properly numbered table, if
that's what you need.

Bob Stayton
Sagehill Enterprises
DocBook Consulting
bobs@sagehill.net


----- Original Message ----- 
From: "Harald Finster" <hfinster@gmx.de>
To: <docbook-apps@lists.oasis-open.org>
Sent: Saturday, March 13, 2004 7:17 AM
Subject: [docbook-apps] nonbreaking tables


> Hello,
>
> probably a simple newbie question again:
>
> Is there a way to keep tables together and to avoid
> (short) tables beeing split into parts across different
> pages?
>
> I tried DSSSL with openjade and dsssl-stylesheets-1.77
> which splits tables and adds a new table header to the
> table's second part (on the new page).
>
> Alternatively, I went the FO way:
>
> xsltproc
> --output xxx.fo
> --stringparam tex.math.in.alt latex
> --stringparam passivetex.extensions 1
> <path-to>/docbook-xsl-1.64.1/fo/docbook.xsl xxx.xml
>
> pdftex --interaction nonstopmode "&pdfxmltex" xxx.fo
>
>
> This approach does not seem to split tables.
> However all vertical separators are missing.
>
>
> I had a look at the docbook-archive trying to find
> an answer. There has been some discussion about
> a 'workaround' to make graphics 'float' by including
> them into tables, which can be made 'floating' (?)
> How?
>
> Thanks for any feedback.
>
> Greetings
>
> Harald
>
> -- 
> Dr.-Ing. Harald Finster / Aachen Germany
> http://www.finster-stahlart.de industrial history and architecture
> http://www.astrid-aix.de       gallery: watercolours and oil paintings
>
>
> To unsubscribe from this list, send a post to
docbook-apps-unsubscribe@lists.oasis-open.org, or visit
http://www.oasis-open.org/mlmanage/.
>
>
>




[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]