RE: [xsl] Please help in XSL

Subject: RE: [xsl] Please help in XSL
From: Jarno.Elovirta@xxxxxxxxx
Date: Mon, 5 Nov 2001 11:07:27 +0200
Hip hei!

> The result / the xsl should show a table :
> 1) paint the bgcolor for all the column where at the first 
> row and with the text is bold.
> 2) paint the bgcolor for all first column at every row where 
> the text is bold. 

My XSL's bit rusty, but this should do it 

  <fo:table inline-progression-dimension="auto"
            table-layout="auto" >
    <xsl:for-each select="tr[1]/td">
      <fo:table-column>
        <xsl:if test="para/bold">
          <xsl:attribute name="background-color">red</xsl:attribute>

        </xsl:if>
      </fo:table-column>
    </xsl:for-each>
    <fo:table-body>
      <xsl:for-each select="tr">
        <fo:table-row>
          <xsl:if test="td[1]/para/bold">
            <xsl:attribute name="background-color">red</xsl:attribute>

          </xsl:if>
          <xsl:for-each select="td">
            <fo:table-cell>
              <fo:block>
                <xsl:value-of select="para" />
              </fo:block>
            </fo:table-cell>
          </xsl:for-each>
        </fo:table-row>
      </xsl:for-each>
    </fo:table-body>
  </fo:table>

Make sure the current node it the parent of the tr elements and adjust the
properties to suit your needs. Hope this helps,

Jarno

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


Current Thread