AW: [xsl] firing on more than one match

Subject: AW: [xsl] firing on more than one match
From: Ronald Kent Gibson <Kent.Gibson@xxxxxxxxxxx>
Date: Mon, 20 Oct 2003 11:02:35 +0200
thanks for all the answers!

-----Ursprüngliche Nachricht-----
Von: Lars Huttar [mailto:lars_huttar@xxxxxxx]
Gesendet: Freitag, 17. Oktober 2003 18:53
An: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Betreff: RE: [xsl] 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'>

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!


 XSL-List info and archive:

 XSL-List info and archive:

Current Thread