xsl-list
[Top] [All Lists]

Keeping varying number of rows together

2003-02-20 08:29:00
I need to keep small clumps of table rows together on the same page, but the
solutions I've seen posted here are not working.  Assume the XML document
looks like this:

------------------------------

<record>
  <line stuff="aaa"/>
</record>
<record>
  <line stuff="bbb"/>
  <line stuff="bbb"/>
  <line stuff="bbb"/>
</record>
<record>
  <line stuff="ccc"/>
  <line stuff="ccc"/>
</record>

------------------------------

... and so forth.

Each record will contain from one to 'N' lines, where 'N' will probably be
less than five (5) or six (6).  This does NOT work:

------------------------------

<xsl:for-each select="record">

  <xsl:for-each select="line">

    <xsl:if test="position() = 1">
      <fo:table-row>
          ...
      </fo:table-row>
    </xsl:if>

    <xsl:if test="position() > 1">
      <fo:table-row keep-with-previous.within-page="always">
          ...
      </fo:table-row>
    </xsl:if>
    
  </xsl:for-each>

</xsl:for-each>

------------------------------

Any ideas on how to accomplish this goal?  Many thanks.

David Woosley
Iron Mountain Records Management
1000 Campus Drive
Collegeville, PA  19426
610-831-2657



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



<Prev in Thread] Current Thread [Next in Thread>