Reputation: 35
I want to use multiple or
conditions in If
condition in XSLT.
The code I used:
<xsl:if test="$var eq ('xxx','yyy','zzz','mmm')">
When I used the above code I am getting error. How can I fix this?
Upvotes: 0
Views: 70
Reputation: 167716
If you want to compare sequences use the =
operator, not eq
. So assuming you use an XSLT 2 or processor your syntax using $var = ('xxx','yyy','zzz','mmm')
should work. With an XSLT 1 processor the right hand side expression constructing a string sequence is not supported at all as the data types there are primitive values and node-sets and (in XSLT) result tree fragments but not sequences of strings or types in general.
Upvotes: 1