Re: Shading columns with a background color

From
Colin Shapiro <>
Date
2007-07-20T17:16:09+00:00
ID
Thread
Re: Shading columns with a background color
My apologies, I had some typos in the code I posted.  Here it is again:

<xsl:param name="column.count
" select="3"/><xsl:param name="column.gap" select="0.1in"/>
<xsl:param name="page.width" select="8.5in"/>
<xsl:variable name="column.gap.pt">
  <xsl:call-template name="length-in-points">    <xsl:with-param name="length" select="$column.gap"/>
  </xsl:call-template>
</xsl:variable><xsl:variable name="page.width.pt">
  <xsl:call-template name="length-in-points">    <xsl:with-param name="length" select="$page.width"/>
  </xsl:call-template>
</xsl:variable><xsl:variable name="
column.width.pt">  <xsl:value-of select="($page.width.pt -
                         (($column.count - 1) *                           $column.gap.pt))
                        div $column.count"/>
</xsl:variable><xsl:template name="column.shading">
  <xsl:param name="column.number" select="1"/>
  <xsl:if test="$column.number &lt;= $column.count">
    <fo:block-container absolute-position="absolute"  
                        background-color="gray"                        height="100%"
                        width="{$column.width}pt">      <xsl:attribute name="left">
        <xsl:value-of select="($column.number - 1) *
                              ($column.width.pt +                               $column.gap.pt)"/>
        <xsl:text>pt</xsl:text>      </xsl:attribute>
      <fo:block/>
    </fo:block-container>    <xsl:call-template name="
column.shading">      <xsl:with-param name="column.number" select="$column.number + 1"/>
    </xsl:call-template>
  </xsl:if></xsl:template>