[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: How to tell if no data returned

Subject: Re: How to tell if no data returned
From: George Cristian Bina <george@xxxxxxxxxxxxx>
Date: Mon, 02 Oct 2006 11:32:02 +0300
foreach in if
Hi Gary,

Just test the for-each expression after the for-each instruction and output whatever note you want there

<xsl:for-each="someExpression">
...
</xsl:for-each>
<xsl:if test="not(someExpression)">
  <note>someExpression does not select any nodes</note>
</xsl:if>

Best Regards,
George
---------------------------------------------------------------------
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com


Garry 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.

Any suggestions how I might do this.

Thanks
Garry


<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>

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.