Subject: [xsl] Do something if no items in for-each meet criteria From: Peter Hollingsworth <peter@xxxxxxxxxxxxxxxxx> Date: Thu, 11 Sep 2003 16:11:57 -0700 |
I'm trying to 1) go through a set of nodes 2) if any matches my criteria, display it 3) if NONE matches my criteria, display a message like "None"
For example, imagine this xml listing some animals: <animal> <type>snake</type> <furry>false</furry> </animal> <animal> <type>fish</type> <furry>false</furry> </animal>
and this XSL that lists all the ones with fur: The following animals are furry:<br/> <xsl:for-each select="animal"> <xsl:if test="furry = 'true'"> <xsl:value-of select="type"/><br/> </xsl:if> </xsl:for-each> [if no animals were furry, print "None are furry"] <---how can I do this?
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] [announce] XMLSPY 2004 av, Michael Kay | Thread | RE: [xsl] Do something if no items , Xia Li |
[xsl] [announce] XMLSPY 2004 availa, Larry E. Kim | Date | RE: [xsl] Do something if no items , Xia Li |
Month |