Subject: Re: [xsl] How to tell if no data returned From: "andrew welch" <andrew.j.welch@xxxxxxxxx> Date: Mon, 2 Oct 2006 09:35:02 +0100 |
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>
<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[@cno=$paramVal1]/competition/leg/stage[@no=$sNum]/classification[@type = 'STAGE']/competitor"
cheers andrew
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] How to tell if no data re, George Cristian Bina | Thread | RE: [xsl] How to tell if no data re, Garry |
Re: [xsl] How to tell if no data re, George Cristian Bina | Date | RE: [xsl] How to tell if no data re, Garry |
Month |