This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: Please help in XSL
- To: xsl-list at lists dot mulberrytech dot com
- Subject: RE: [xsl] Please help in XSL
- From: Jarno dot Elovirta at nokia dot com
- Date: Mon, 5 Nov 2001 11:07:27 +0200
- Reply-To: xsl-list at lists dot mulberrytech dot com
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