Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <xsl:for-each select="./node [position() <= (count(*) div 2)]">
- <li>foo</li>
- </xsl:for-each>
- <xsl:for-each select="./node [count(*) div 2 < position()]">
- <li>bar</li>
- </xsl:for-each>
- <xsl:variable name="nodes" select="node"/>
- <xsl:variable name="mid" select="count($nodes) div 2"/>
- <xsl:for-each select="$nodes[position() <= $mid]">
- <li>foo</li>
- </xsl:for-each>
- <xsl:for-each select="$nodes[$mid < position()]">
- <li>bar</li>
- </xsl:for-each>
- <xsl:for-each select="./node [position() <= last() div 2]">
- <li>foo</li>
- </xsl:for-each>
- <xsl:for-each select="./node [last() div 2 < position()]">
- <li>bar</li>
- </xsl:for-each>
- <xsl:for-each select="node[position() <= (count(../node) div 2)]">
- ...
- </xsl:for-each>
- <xsl:for-each select="node[(count(../node) div 2) < position()]">
- ...
- </xsl:for-each>
Add Comment
Please, Sign In to add comment