|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: firing on more than one match
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








