Note however, this is invalid. Each template inside the <xsl:when> and <xsl:otherwise> must be well-formed XML markup. In the first instance, you have an unclosed <tr>, while in the second you never had an open <tr>.

I've been trying to do this for awhile, but didn't think it could be done since XSL doesn't support bitwise operators. Getting the position of parent <for-each>'s would be more difficult, but could probably be done with more when / otherwise.

KC-Luck

02-06-2006, 02:54 PM

one thing to note is that a mixed childNodes set could throw this type of simple-calculation off, eg: