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] PDF Table Row processing


Ah, when I tested FOP I had used keep-together.within-page="always"
and that did not work.  But keep-together="always" (without the within-page
qualifier) does work on a row in FOP. Thanks for the tip.

This means a customization like this of the match="row" template found
in fo/table.xsl will keep rows together in FOP output:

<xsl:param name="keep.row.together">1</xsl:param>

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

  <fo:table-row>
   <xsl:if test="$keep.row.together != '0'">
    <xsl:attribute name="keep-together">always</xsl:attribute>
  </xsl:if>
    <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>

I created a new "keep.row.together" parameter to control the
behavior because sometimes you may not want it.  It will apply
to all rows of tables in the document, of course.

Bob Stayton
Sagehill Enterprises
bobs@sagehill.net


----- Original Message ----- 
From: <vhikida@inreach.com>
To: "Bob Stayton" <bobs@sagehill.net>
Cc: <webdesign@dawnmist.net>; <docbook-apps@lists.oasis-open.org>
Sent: Thursday, January 22, 2004 4:02 PM
Subject: Re: [docbook-apps] PDF Table Row processing


> I'm very new to XSL-FO and FOP and I had this problem also. I found a work
> around on google but I don't remember where. However, I've used it in my
> own XSL file and it did work. My understanding is that keep-together=all
> works for table cells in FOP. In my case I needed to keep together a table
> which is usually 3 or 4 lines of parole information together on a report.
> I used the following code.
>
> <fo:table table-layout="fixed" width="100%">
>     <fo:table-column column-width="proportional-column-width(1)"/>
>     <fo:table-body>
>     <fo:table-row keep-together="always">
>     <fo:table-cell>
>     <fo:block>
>        <xsl:apply-templates select="probations-paroles"/>
>     </fo:block>
>     </fo:table-cell>
>     </fo:table-row>
>     </fo:table-body>
> </fo:table>
>
> It should be noted that probations-paroles defines a list of paroles and
> probations. Somewhat ugly but this works.
>
> Vincent
>
>
> > FOP's implementation of the "keep" mechanism is incomplete
> > in its current version.  I tried putting keep-together properties on
> > both table-row and table-cells in the FO output, and they
> > had no effect with FOP.
> >
> > The only property that worked was break-before="page" on the
> > fo:table-row element.  But you don't want that on every row, of course.
> > You could customize the template for table rows to look for a
> > processing instruction that you put in your row when you want to
> > force a manual break.  It's a very ugly solution, and a maintenance
> > headache if the file changes.
> >
> > Bob Stayton
> > Sagehill Enterprises
> > bobs@sagehill.net
> >
> >
> > ----- Original Message -----
> > From: "Janeene Webb" <webdesign@dawnmist.net>
> > To: <docbook-apps@lists.oasis-open.org>
> > Sent: Wednesday, January 21, 2004 7:36 PM
> > Subject: [docbook-apps] PDF Table Row processing
> >
> >
> >> Hi,
> >>
> >> Am wondering if there is any way to specify that a table is *not* to
> >> split
> > a
> >> row over a page-break when being converted into a PDF file? I've got a
> >> document which is using tables for a long list of reports within a
> > program,
> >> their titles, shortcut codes, descriptions, etc. Each "row" in the
table
> >> would vary between 3 and 10 lines high. As such, I'm finding that
> > sometimes
> >> at the bottom of the page I'd get the first line of a row on that page
> >> and
> >> the other 5 lines (for a 6 line row) on the next - which does dreadful
> > things
> >> to the clarity of the data, since the report title can be split in
half,
> > not
> >> to mention the rest!
> >>
> >> Am using the xsl 1.62.4 stylesheets and saxon + fop 0.20.5 for the
> > processing.
> >>
> >> Cheers,
> >> Janeene Webb.
> >>
> >> To unsubscribe from this list, send a post to
> > docbook-apps-unsubscribe@lists.oasis-open.org, or visit
> > http://www.oasis-open.org/mlmanage/.
> >>
> >>
> >>
> >
> >
> >
> > To unsubscribe from this list, send a post to
> > docbook-apps-unsubscribe@lists.oasis-open.org, or visit
> > http://www.oasis-open.org/mlmanage/.
> >
> >
>
>
> 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]