On 10/2/06, Garry <garry(_at_)justimagine(_dot_)com(_dot_)au> wrote:
Hi all
I have a problem which I would normally fix using a variable. I have a
routine similar to that below. What I want to know is if it doesnt get into
the for-each loop. If it doesnt it means no rows are written and I would
like to add a note to the page if this is the case.
<xsl:for-each
select="/stages/competition/leg/stage/classification/competitor[../../@no=$s
Num]">
<xsl:if test="../@type = 'STAGE'">
<xsl:if test="../../../../@cno=$paramVal1">
... row detail written here
</xsl:if>
</xsl:if>
</xsl:for-each>
Well a exact conversion would be:
<xsl:variable name="competitors"
select="/stages/competition/leg/stage/classification/competitor[../../@no=$sNum]"/>
<xsl:choose>
<xsl:when test="$competitors">
<xsl:for-each select="$competitors">
....
</
<xsl:otherwise>
note....
But if those xsl:if's are the only children of the xsl:for-each then
the variable should really be:
select="/stages[(_at_)cno=$paramVal1]/competition/leg/stage[(_at_)no=$sNum]/classification[(_at_)type
= 'STAGE']/competitor"
cheers
andrew
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--