How to add multiple test conditions in ‘test’ attribute expression of tag

<xsl:if test="$var="ab" | $var="bc" | $var="ca" ">

This is wrong — you are using the XPath union operator | on boolean values.

Solution: use the XPath or operator:

<xsl:if test="$var="ab" or $var="bc" or $var="ca" ">

The above XPath expression (the value of the test attribute) can be optimized, so that only one comparison is made and no or is necessary:

<xsl:if test="contains('|ab|bc|ca|', concat('|', $var, '|'))">

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)