Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: [xsl] How to tell if no data returned

From: George Cristian Bina <george@------------->
To:
Date: 10/2/2006 8:33:00 AM
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
www.---.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>


transparent
Print
Mail
Digg
delicious
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent