xsl-list
[Top] [All Lists]

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

2006-10-02 01:32:31
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>


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>