This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: need a hint on matching table cells
- From: "J.Pietschmann" <j3322ptm at yahoo dot de>
- To: xsl-list at lists dot mulberrytech dot com
- Date: Thu, 18 Jul 2002 01:02:22 +0200
- Subject: Re: [xsl] need a hint on matching table cells
- References: <C0813D854A46F249A72DC407680227A9A2DEF3@mail1.tririga.com>
- Reply-to: xsl-list at lists dot mulberrytech dot com
Brad Miller wrote:
<xsl:template match="T-BODY/ROW">
<tr>
<xsl:if test="CELL/@SPAN = 'grey'">
<td colspan="2" class="grey"><xsl:apply-templates select = "CELL" /></td>
First: the test is true if there is *at least one* CELL
with a @SPAN='grey' in the row. Furthermore you are
matching *all* CELL elements here. Therefore you get
one <td> with the content of all CELL elements in it.
The next xsl:if matches too, and you get another td
etc.
Probably you want
<xsl:template match="T-BODY/ROW">
<tr>
<xsl:apply-templates/>
</tr>
</xsl:template>
<xsl:template match="CELL[@SPAN = 'grey']">
<td colspan="2" class="grey">
<xsl:apply-templates/>
</td>
</xsl:template>
<xsl:template match="CELL[@SPAN = 'lightgrey']">
<td colspan="2" class="lightgrey">
<xsl:apply-templates/>
</td>
</xsl:template>
etc.
J.Pietschmann
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list