in reply to OT - Dynamic data into columns in XSLT

Something like this:
<xsl:variable name="cols" select="5"/> <xsl:variable name="rows" select="ceiling(last() / $cols)"/> <xsl:for-each select="yourTag[position() &lt;= $rows"> <tr> <!-- self::position() below refers to the value of position() HERE + --> <xsl:for-each select="yourTag[position() mod $rows = self::positio +n()]"> <td><xsl:value-of select="..."/></td> </xsl:for-each> </tr> </xsl:for-each>

Replies are listed 'Best First'.
Re^2: OT - Dynamic data into columns in XSLT
by Anonymous Monk on Dec 20, 2005 at 21:16 UTC

    Actually, that would only work as current()/position(), since the self:: axis refers to the predicate context.

    Whatever. Just stick the position() in an xsl:variable and call it good enough.

Re^2: OT - Dynamic data into columns in XSLT
by rashley (Scribe) on Dec 21, 2005 at 16:06 UTC
    I came up with something very similar to this as well.

    Unfortunately, it turns out that there's something wrong with our system that's causing the

    Element[n]
    syntax to evaluate incorrectly.

    As long as that's the case, this can't be solved.

    Still, thanks for the input.