![]() |
![]() | ![]() | ![]() | Altova Mailing List Archives>Archive Index >xsl-list Archive Home >Recent entries >Thread Prev - [xsl] How to tell if no data returned >Thread Next - RE: [xsl] How to tell if no data returned Re: [xsl] How to tell if no data returnedTo: Date: 10/2/2006 8:35:00 AM On 10/2/06, Garry <garry@xxxxxxxxxxxxxxxxxx> 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[@cno=$paramVal1]/competition/leg/stage[@no=$sNum]/classification[@type
= 'STAGE']/competitor"
cheers
andrew | ![]() | ![]() | ![]() |
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | |||||
|
