[xsl] Column widths

Subject: [xsl] Column widths
From: Gustaf Liljegren <gustafl@xxxxxxxxxx>
Date: Sat, 22 Jun 2002 16:17:14 +0200
Thanks for all help with my last problem. Today I got a problem with column
widths. I use the XHTML table model, and this is in the <td> and <th>
templates:

<xsl:variable name="x" select="position()"/>
...
<xsl:if test="ancestor::table//col[$x]/attribute::width">
  <xsl:attribute name="width">
    <xsl:value-of select="ancestor::table//col[$x]/attribute::width"/>
  </xsl:attribute>
</xsl:if>

I try to add a width attribute to <fo:table-cell> here, but what happens is
that I get the first column's width on every cell, except the last which
gets no width attribute at all.

XPath seem to suggest a syntax with [ and ] for attributes, like
ancestor::table//col[$x][attribute::width]. I tried that too, but then all
width attributes was empty (except the last which has no attribute).

Gustaf


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


Current Thread