[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: "Lars Huttar" <lars_huttar@xxxxxxx>
Date: Fri, 17 Oct 2003 11:53:14 -0500
RE:  firing on more than one match
Hello Kent,

Ronald Kent Gibson wrote:

> 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>

Taken literally, there can't be more than one node "/ruledef" in
an XML document, since there can only be one document node.

But assuming there are multiple ruledef nodes somewhere, the test
  <xsl:when test="ruledef/@pageeject = 'yes'>
     [Result]
  </xsl:when>

will do what it seems you want: it will generate the [Result]
whenever *any* element (child of the current node in this case)
named "ruledef" has a "pageeject" attribute with the value "yes".

You don't need a loop; XPath semantics are like a database query,
with the "does any such thing exist" idea built in.

> I don't thinkr recursion will help, either. So can anyone 
> kindly give me
> some suggestions, thanks and enjoy the weekend.

You too!

Lars


 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.