xsl compound conditional, xml%%%xsl compound conditional - Using

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

Using | with multiple attribute values

Subject: Using | with multiple attribute values
From: Ross Bleakney <rossb@xxxxxxx>
Date: Tue, 23 Nov 1999 15:24:24 -0800
xsl compound conditional
Hello,
Given the following XML snippet:
<Records>
	<Record name="John">
</Records>

I would like to output "Smith" if the "name" attribute is "John" or "Joe". I
can do this with this XSL snippet:

<xsl:for-each select="Records/Record">
	<xsl:if test="@name='John'">Smith</xsl:if>  
	<xsl:if test="@name='Joe'">Smith</xsl:if>  
</xsl:for-each>

However, I would like to use a compound conditional and do this in one line.
I have tried this:
	<xsl:if test="@name='John|Joe'">Smith</xsl:if>  
But that doesn't work.

I have also tried this:
	<xsl:if test="@name='John'|'Joe'">Smith</xsl:if>  
or this:
	<xsl:if test="@name='John'|@name='Joe'">Smith</xsl:if>  

In both of these cases, the parser I am using (Lotus XSL with XML4J)
crashes. If this is a flaw in LotusXSL then it is not meant as a criticism.
I realize that the product is pre-Beta ("Developer Preview") and this is the
first problem I have had with it. 

Is LotusXSL simply failing with my correct syntax? If so, can anyone think
of an alternative work-around? If not, is there a better way of doing this?

Thanks,
Ross


 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.