Hi,
As part of an XSL translation I am trying to throw together I need to be able to tell if an "xsl:if" in a "xsl:for-each" loop is ever entered. Specificly I need to know this after the loop is completed to know if I should add a new line.
Normally I would just change a boolean value inside the if test to check this, but XSL does not allow variables to be changed after they are set so that is not an option.
I know people have come up with creative solutions to get around the variable limitations to make things like counters. So I was wondering if anyone knew of a creative was to do this.
As part of an XSL translation I am trying to throw together I need to be able to tell if an "xsl:if" in a "xsl:for-each" loop is ever entered. Specificly I need to know this after the loop is completed to know if I should add a new line.
Normally I would just change a boolean value inside the if test to check this, but XSL does not allow variables to be changed after they are set so that is not an option.
I know people have come up with creative solutions to get around the variable limitations to make things like counters. So I was wondering if anyone knew of a creative was to do this.
Code:
<xsl:for-each select="//someTagName">
<xsl:if test="@name = 'bob' ">
<!-- Need to be able to if this if test is entered after the loop is done-->
</xsl:if>
</xsl:for-each>
<!--
This is where I need to know if the above test was triggered so I can know
if I should start a new line.
-->
Comment