Try this:
<xsl:for-each select="parent/child[position() mod 2 =
0]">
<tr> <td><xsl:value-of
select="preceding-sibling::child/name"/></td>
<td><xsl:value-of select="name"/></td>
</tr> </xsl:for-each> and as you can see you can make this
work for any number of columns:
<xsl:for-each select="parent/child[position() mod 4 =
0]">
<tr> <td><xsl:value-of
select="preceding-sibling::child[3]/name"/></td>
<td><xsl:value-of
select="preceding-sibling::child[2]/name"/></td>
<td><xsl:value-of
select="preceding-sibling::child[1]/name"/></td>
<td><xsl:value-of select="name"/></td>
</tr> </xsl:for-each> Just be aware that the preceding-sibling:: axis
is a reverse axis so counting is reverse document order.
Perry
|
- work around for <xsl:text disable-output-escaping="... Robert McKinnon
- Re: work around for <xsl:text disable-output-escap... Gustavo Mejia
- C2: XSLT malfunction Eduardo Yánez
- C2: initialization error Martin Mauri
- Re: C2: initialization error giacomo
- Re: C2: initialization error Martin Mauri
- Re: C2: initialization error java guru
- RE: work around for <xsl:text disable-output-escap... Perry Molendijk
- RE: work around for <xsl:text disable-output-e... Robert McKinnon