[xsl] Include background colour in overflow row

Subject: [xsl] Include background colour in overflow row
From: "James Steven" <JSteven@xxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 7 Oct 2004 09:40:33 +0100
Hello 
 
I have created a table using xsl-fo.  The table includes a column which has
an overflow in it that continues to the row below.  As the row continues so
does the background colour which is set for that column.  The same
background colour is set for the other columns in that row but they do not
continue to the next row when this overflow occurs.  How can I get the
background colour for the other columns to fill the next row when there is
an overflow?
 
eg. In the table below the description 'This is the Primary Key for
Accommodation Types' overflows to the next row and fills that column's part
of the row with its background colour.  Can I fill the row below in the
columns for 'Accommodation Type' and 'Description'?
 
Accommodation_Types
Column               Properties
Accommodation Type   Description  This is the Primary Key forAccommodation
                                  Types
                     DataType     smallint (2)
 
Thanks for any help.
James

XML:
<Dictionary>
  <Table Name="Accommodation_Types">
    <Column Name="AccommodationType">
      <Description>This is the Primary Key for Accommodtion Types
      </Description>
      <DataType>smallint (2)</DataType>
    </Column>
    <Column Name="Active">
      <Description>This is to see if the Accommodation type is Active
      </Description>
      <DataType>bit (1)</DataType>
    </Column>
    <Column Name="Description">
      <Description>Description of Accommodation Type</Description>
      <DataType>char (35)</DataType>
    </Column>
   </Table>
</Dictionary>

XSL snip:
 <xsl:attribute-set name="orderlist.table.detail.textcolumns">
        <xsl:attribute name="border-top-style">none</xsl:attribute>
        <xsl:attribute name="border-bottom-style">none</xsl:attribute>
        <xsl:attribute name="border-width"></xsl:attribute>
        <xsl:attribute name="display-align">before</xsl:attribute>
        <xsl:attribute name="text-align">start</xsl:attribute>
        <xsl:attribute name="padding-right">0.5mm</xsl:attribute>
        <xsl:attribute name="padding-left">.5mm</xsl:attribute>
        <xsl:attribute name="padding-bottom">.5mm</xsl:attribute>
        <xsl:attribute name="padding-top">.5mm</xsl:attribute>
    </xsl:attribute-set>

   <xsl:attribute-set name="orderlist.table.detail.textcolumns3">
       <xsl:attribute name="border-top-style">none</xsl:attribute>
       <xsl:attribute name="border-bottom-style">none</xsl:attribute>
       <xsl:attribute name="border-width">
	 </xsl:attribute>
       <xsl:attribute name="display-align">before</xsl:attribute>
       <xsl:attribute name="text-align">start</xsl:attribute>
       <xsl:attribute name="padding-right">0.5mm</xsl:attribute>
       <xsl:attribute name="padding-left">.5mm</xsl:attribute>
       <xsl:attribute name="padding-top">.5mm</xsl:attribute>
    </xsl:attribute-set>

    <xsl:attribute-set name="orderlist.table.detail.blocks">
        <xsl:attribute name="padding-right">0.5mm</xsl:attribute>
        <xsl:attribute name="padding-left">.5mm</xsl:attribute>
        <xsl:attribute name="padding-bottom">.5mm</xsl:attribute>
        <xsl:attribute name="padding-top">.5mm</xsl:attribute>
        <xsl:attribute name="font-size">10pt</xsl:attribute>
        <xsl:attribute name="font-family">sans-serif</xsl:attribute>
    </xsl:attribute-set>

   <xsl:for-each select="Table">
   <fo:table table-layout="fixed">
    <fo:table-column column-width="180mm"/>
    <fo:table-body>
     <fo:table-row>
     <fo:table-cell>
      <fo:block space-before.optimum="5mm">
      </fo:block>
	 </fo:table-cell>
	 </fo:table-row>
    <fo:table-row>
     <fo:table-cell
xsl:use-attribute-sets="orderlist.table.detail.textcolumns">
      <fo:block xsl:use-attribute-sets="orderlist.table.detail.blocks">
	 <xsl:attribute name="background-color">#ffffff</xsl:attribute>
	 <xsl:attribute name="font-weight">bold</xsl:attribute>
	 <xsl:value-of select="@Name" />
      </fo:block>
      </fo:table-cell>
	 </fo:table-row>
	  </fo:table-body>
	 </fo:table>
  <fo:table table-layout="fixed">
   <fo:table-column column-width="67mm" />
   <fo:table-column column-width="1mm" />
   <fo:table-column column-width="112mm" />
    <fo:table-body>
     <fo:table-row>
      <fo:table-cell
xsl:use-attribute-sets="orderlist.table.detail.textcolumns">
       <fo:block font-weight="bold" background-color="#cccccc" 
         text-align="start" font-size="10pt" fontfamily="sans-serif">
        <xsl:attribute name="padding-right">0.5mm</xsl:attribute>
        <xsl:attribute name="padding-left">.5mm</xsl:attribute>
        <xsl:attribute name="padding-bottom">.5mm</xsl:attribute>
        <xsl:attribute name="padding-top">.5mm</xsl:attribute>
        Column</fo:block>
         </fo:table-cell>
         <fo:table-cell>
         </fo:table-cell>
         <fo:table-cell
xsl:use-attribute-sets="orderlist.table.detail.textcolumns">
           <fo:block font-weight="bold" background-color="#cccccc"
text-align
            ="start" font-size="10pt" font-family="sans-serif">
             <xsl:attribute name="padding-right">0.5mm</xsl:attribute>
             <xsl:attribute name="padding-left">.5mm</xsl:attribute>
             <xsl:attribute name="padding-bottom">.5mm</xsl:attribute>
             <xsl:attribute name="padding-top">.5mm</xsl:attribute>
             Properties</fo:block>
         </fo:table-cell>
       </fo:table-row>
      </fo:table-body>
    </fo:table>
    <fo:table table-layout="fixed">
      <fo:table-column column-width="67mm"/>
	<fo:table-column column-width="1mm" />
	<fo:table-column column-width="34mm"/>
      <fo:table-column column-width="1mm"/>
      <fo:table-column column-width="77mm" />
     <fo:table-body>
      <xsl:for-each select="Column">
        <fo:table-row>
         <xsl:if test="position() mod 2 = 1">
          <fo:table-cell
xsl:use-attribute-sets="orderlist.table.detail.textcolumns3">
            <fo:block
xsl:use-attribute-sets="orderlist.table.detail.blocks">
              <xsl:attribute name="background-color">#eeeeee</xsl:attribute>
              <xsl:value-of select="@Name" />
             </fo:block>
            </fo:table-cell>
         </xsl:if>
         <xsl:if test="position() mod 2 = 0">
           <fo:table-cell
xsl:use-attribute-sets="orderlist.table.detail.textcolumns3">
            <fo:block
xsl:use-attribute-sets="orderlist.table.detail.blocks">
             <xsl:attribute name="background-color">#ffffff</xsl:attribute>
              <xsl:value-of select="@Name" />
             </fo:block>
            </fo:table-cell>
         </xsl:if>
          <fo:table-cell>
          </fo:table-cell>
         <xsl:if test='./Description'>
         <xsl:if test="position() mod 2 = 1">
          <fo:table-cell
xsl:use-attribute-sets="orderlist.table.detail.textcolumns">
	     <fo:block font-weight="bold" background-color="#eeeeee"
text-align
            ="start" font-size="10pt" font-family="sans-serif">
	       <xsl:attribute name="padding-right">0.5mm</xsl:attribute>
		 <xsl:attribute name="padding-left">.5mm</xsl:attribute>
		 <xsl:attribute name="padding-bottom">.5mm</xsl:attribute>
		 <xsl:attribute name="padding-top">.5mm</xsl:attribute>
		 Description</fo:block>
           </fo:table-cell>
          </xsl:if>
          <xsl:if test="position() mod 2 = 0">
           <fo:table-cell
xsl:use-attribute-sets="orderlist.table.detail.textcolumns">
	      <fo:block font-weight="bold" background-color="#ffffff"
text-align
             ="start" font-size="10pt" font-family="sans-serif">
	       <xsl:attribute name="padding-right">0.5mm</xsl:attribute>
		 <xsl:attribute name="padding-left">.5mm</xsl:attribute>
		 <xsl:attribute name="padding-bottom">.5mm</xsl:attribute>
		 <xsl:attribute name="padding-top">.5mm</xsl:attribute>
		 Description</fo:block>
           </fo:table-cell>
           </xsl:if>
            <fo:table-cell>
            </fo:table-cell>
           <xsl:if test="position() mod 2 = 1">
            <fo:table-cell
xsl:use-attribute-sets="orderlist.table.detail.textcolumns">
              <fo:block
xsl:use-attribute-sets="orderlist.table.detail.blocks">
                <xsl:attribute
name="background-color">#eeeeee</xsl:attribute>
                  <xsl:value-of select="./Description" />
               </fo:block>
             </fo:table-cell>
            </xsl:if>
            <xsl:if test="position()mod 2 = 0">
             <fo:table-cell
xsl:use-attribute-sets="orderlist.table.detail.textcolumns">
               <fo:block
xsl:use-attribute-sets="orderlist.table.detail.blocks">
                 <xsl:attribute
name="background-color">#ffffff</xsl:attribute>
                 <xsl:value-of select="./Description" />
               </fo:block>
               </fo:table-cell>
              </xsl:if>
              </xsl:if>
               </fo:table-row>
              <xsl:if test='./DataType'>
               <fo:table-row>
             <xsl:if test="position()mod 2 = 1">
               <fo:table-cell
xsl:use-attribute-sets="orderlist.table.detail.textcolumns2">
			<xsl:attribute
name="background-color">#eeeeee</xsl:attribute>&#160;
		</fo:table-cell>
		</xsl:if>
		<xsl:if test="position() mod 2 = 0">
		  <fo:table-cell
xsl:use-attribute-sets="orderlist.table.detail.textcolumns2">
		   <xsl:attribute
name="background-color">#ffffff</xsl:attribute>&#160;
		  </fo:table-cell>
            </xsl:if>
              <fo:table-cell>
              </fo:table-cell>
            <xsl:if test="position() mod 2 = 1">
              <fo:table-cell
xsl:use-attribute-sets="orderlist.table.detail.textcolumns">
		   <fo:block font-weight="bold" background-color="#eeeeee"
text-align
                ="start" font-size="10pt" font-family="sans-serif">
		     <xsl:attribute
name="padding-right">0.5mm</xsl:attribute>
		     <xsl:attribute name="padding-left">.5mm</xsl:attribute>
		     <xsl:attribute
name="padding-bottom">.5mm</xsl:attribute>
		     <xsl:attribute name="padding-top">.5mm</xsl:attribute>
		     DataType</fo:block>
		   </fo:table-cell>
		</xsl:if>
		<xsl:if test="position() mod 2 = 0">
		 <fo:table-cell
xsl:use-attribute-sets="orderlist.table.detail.textcolumns">
		   <fo:block font-weight="bold" background-color="#ffffff"
text-align
                ="start" font-size="10pt" font-family="sans-serif">
		    <xsl:attribute
name="padding-right">0.5mm</xsl:attribute>
		    <xsl:attribute name="padding-left">.5mm</xsl:attribute>
		    <xsl:attribute
name="padding-bottom">.5mm</xsl:attribute>
		    <xsl:attribute name="padding-top">.5mm</xsl:attribute>
		    DataType</fo:block>
		   </fo:table-cell>
            </xsl:if>
             <fo:table-cell>
             </fo:table-cell>
                <xsl:if test="position()mod 2 = 1">
             <fo:table-cell
xsl:use-attribute-sets="orderlist.table.detail.textcolumns">
                <fo:block
xsl:use-attribute-sets="orderlist.table.detail.blocks">
                 <xsl:attribute
name="background-color">#eeeeee</xsl:attribute>
                 <xsl:value-of select="./DataType" />
                </fo:block>
              </fo:table-cell>
             </xsl:if>
             <xsl:if test="position()mod 2 = 0">
             <fo:table-cell
xsl:use-attribute-sets="orderlist.table.detail.textcolumns">
              <fo:block
xsl:use-attribute-sets="orderlist.table.detail.blocks">
                <xsl:attribute
name="background-color">#ffffff</xsl:attribute>
                <xsl:value-of select="./DataType" />
              </fo:block>
             </fo:table-cell>
             </xsl:if>
            </fo:table-row>
            </xsl:if>
           </xsl:for-each>
         </fo:table-body>
      </fo:table>
   </xsl:for-each>

This message has been scanned for unacceptable content by 'VITANIUM'
the industry leading email virus and content management service from
Vitanium Systems. Contact details are available at www.vitanium.com.

Current Thread