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] Long tables in HTML


This is a known problem in the DocBook table processing templates.  CALS
tables are processed by recursing on rows in order to calculate row spans,
which can start at any point in a table.  In Saxon, the recursion depth
seems to be about 600, so your table goes beyond that.  Norm Walsh and I
have studied this problem, and neither of us can come up with a way to
support row spans without using recursion.  The problem is marked as
unfixable in the DocBook bugs database.

The workaround is to divide each group of 550 rows into separate tgroup
elements within the same table.  In order for the columns in the segments
to line up, each tgroup must specify the column widths the same.

If you aren't using FOP, then there is another step required.  The default
value of the FO table-layout property is "auto", which can alter the
suggested column width specifications.  This needs to be the value "fixed"
if you use fixed width columns for this solution.  FOP only supports
"fixed", which is why it isn't an issue there (until FOP is improved, that
is).

So one solution is to add a processing instruction like
<?set_column_widths?> to the table.  Then customize the match="tgroup"
template from fo/table.xsl to add the part marked below:

<xsl:template match="tgroup" name="tgroup">
  <xsl:if test="not(@cols)">
    <xsl:message terminate="yes">
      <xsl:text>Error: CALS tables must specify the number of 
columns.</xsl:text>
    </xsl:message>
  </xsl:if>

  <!-- Add this part -->
    <xsl:choose>
      <xsl:when test="ancestor-or-self::table[1]//
                      processing-instruction('set_column_widths') or
                      ancestor-or-self::informaltable[1]//
                      processing-instruction('set_column_widths')">
        <xsl:attribute name="table-layout">fixed</xsl:attribute>
      </xsl:when>
      <xsl:otherwise>
        <xsl:attribute name="table-layout">auto</xsl:attribute>
      </xsl:otherwise>
    </xsl:choose>

When these tgroups are processed for FO output, they join perfectly.  For 
HTML output, there is a gap
between the groups. It isn't really noticeable in such a long table, but it 
could be removed by setting CSS style margins on the HTML tables that are 
generated.

Bob Stayton
Sagehill Enterprises
DocBook Consulting
bobs@sagehill.net


----- Original Message ----- 
From: "Dovid Zalkin" <dovid@tech-tav.com>
To: "Docbook Posting" <docbook-apps@lists.oasis-open.org>
Sent: Thursday, November 09, 2006 8:41 AM
Subject: [docbook-apps] Long tables in HTML


> I'm converting a Docbook XML file which contains a very long table (more
> than 1000 rows) to HTML. Saxon crashes somewhere in the processing of the
> table, with an error message of excessive nesting of apply-templates.
> This problem was duplicated on two different machines. Has anyone
> experienced this or something similar, and, if so, is there a fix
> (besides breaking the table into smaller pieces)?
>
> -- 
> David Zalkin
> Technology Consultant
> Tech-Tav Documentation Ltd.
> +972 (0)57 313 8506
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
> For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org
>
>
>




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