This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: need a hint on matching table cells


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]