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

Re: firing on more than one match

Subject: Re: firing on more than one match
From: Mukul Gandhi <mukulgw3@xxxxxxxxx>
Date: Fri, 17 Oct 2003 10:07:07 -0700 (PDT)
xsl if more than one
For illustration, I have assumed the following XML --

<?xml version="1.0" encoding="UTF-8"?>
<root>
  <ruledef pageeject="yes">1</ruledef>
  <ruledef pageeject="no">2</ruledef>
  <ruledef pageeject="yes">3</ruledef>
  <ruledef pageeject="no">4</ruledef>    
</root>

I hope, you are thinking about an XML of a similar
nature..

The following template tries to illustrate the answer
--

   <xsl:template match="/root">
       <xsl:for-each select="ruledef">
	   <xsl:if test="@pageeject = 'yes' ">
	      Yes
	   </xsl:if>
	   <xsl:if test="@pageeject = 'no' ">
	       No
	    </xsl:if>
       </xsl:for-each>
    </xsl:template>
</xsl:stylesheet>

The above XSL prints, 'Yes' or 'No', depending if the
pageeject attribute is 'yes' or 'no' in the XML..

I hope, I am able to explain correctly..

Regards,
Mukul


--- Ronald Kent Gibson <Kent.Gibson@xxxxxxxxxxx>
wrote:
> 
> Dear All 
> 
> I have something like this, ie there are more is
> more than one node that is
> named ruledef, and I want my condition to fire when
> any of these things are
> equal to the condition.
> 
> <xsl:when test="/ruledef[1]/@pageeject = 'yes'">
> 
> </xsl:when>
> 
> 
> Seems like a loop would be good here, but no loops
> in xslt.
> 
> I don't thinkr recursion will help, either. So can
> anyone kindly give me
> some suggestions, thanks and enjoy the weekend.
> 
> kent
> 
> 
>  XSL-List info and archive: 
> http://www.mulberrytech.com/xsl/xsl-list
> 


__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.