This shouldn't matter. position() calculates the position of
the current
node within the current node list, which is the list of
nodes selected
using <xsl:apply-templates> or <xsl:for-each>. So long as you
select the
nodes to be included using one of those instructions (and not, for
example, by selected a larger set of nodes and then
selecting a subset
using xsl:if or xsl:choose) the position() should be set correctly.
Thanks for your answer, Michael. Actually, I'm doing exactly what you
describe: I select a larger set of nodes, then selecting a
subset with xsl:if. So we're back to the original question:
is there any way to alternate the row color given that
position() won't help me much?
Try to restructure it so you select the subset using xsl:for-each.
Instead of
<xsl:for-each select="x">
<xsl:if test="c">
<tr>
do
<xsl:for-each select="x[c]">
<tr>
should be doing something like:
<xsl:value-of select="name(element[.//*[conditions]][1])"/>
Can you explain more on this? Should "element" stay as such
or be replaced with the real name of the element I'm looking
for (which turns out to be "Sequence").
This was intended as pseudo-code. Substitute the right things for
"element" and "conditions".
Also, "conditions"
need to contain an "xsl:for-each". Is that possible?
No, it's not possible, but are you really sure it is necessary?
Michael Kay
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list