xml editor

Supported platforms

Compatible with Windows7 & Mac OS X Snow Leopard

Ready for data server software
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

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


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

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
XML Editor | XML Author | WYSIWYG Editors | Schema Editor | XSD Documentation | XSL/XSLT Editor | XQuery | XML Databases | SVN Client
© 2002-2011 SyncRO Soft Ltd. All rights reserved. | Sitemap | Privacy Policy | This website was created & generated with <oXygen/>®XML Editor