Is it possible to have a for-each in which the counter is an attribute value (not a node list)?
Here is what I am trying to do, handling colspan in tables (doesn’t work):
<xsl:for-each select=".//tr[1]//td">
<xsl:choose>
<xsl:when test="@colspan">
<xsl:for-each select="@colspan">
<fo:table-column/>
</xsl:for-each>
</xsl:when>
<xsl:otherwise><fo:table-column/></xsl:otherwise>
</xsl:choose>
</xsl:for-each>
Thanks!
In XSLT 2.0:
In XSLT 1.0:
When this transformation is applied on the following XML document:
the wanted, correct result is produced: