Reputation: 5537
How is it possible to check if an array of for example Strings contains a String?
<xsl:if test="inArray('a', $array)"></xsl:if>
Upvotes: 2
Views: 1262
Reputation: 52848
If by array you mean sequence, just use =
...
<xsl:variable name="array" select="('a','b','c')"/>
<xsl:if test="$array='a'"></xsl:if>
You can also test multiple values in an array/sequence (this example will evaluate true if a
or c
exists in the sequence):
<xsl:if test="$array=('a','c')"></xsl:if>
Upvotes: 8