[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] Is there an OR for XSL IF?


Subject: Re: [xsl] Is there an OR for XSL IF?
From: "Murray McDonald" <m.mcdonald@xxxxxxxxx>
Date: Wed, 4 Jan 2012 01:13:20 -0500

I assumed you were using XSLT 2.0 but in case you are using 1.0 here is some
elaboration on testing equality.  (The "or" operator is supported in both)

In XSLT/XPATH 1.0 the "=" operator compares atomic values.

In XSLT/XPATH 2.0 the "eq" operator is used to compare atomic values and the
"=" operator may be used to compare all items in the "left-side" sequence to
all items in the "right-side" sequence and will "return true" if any
left-side item is equal to any right-side item.  If the left and right sides
both specify single-item sequences then "=" will be semantically equivalent
to "eq".  Although you can "get away" with using "=" to compare atomic
values you're better off using "eq".

Take care


Current Thread
Keywords