Create a list/array in XSLT
xslt
Solution
<xsl:variable name="$country" select="Request/country"/>
<xsl:variable name="countries">|EG|KSA|UAE|AG|</xsl:variable>
<xsl:when test="contains($countries,$country)">...</xsl:when>
Problem
I have the following scenario. I have a list of countries (EG, KSA, UAE, AG) I need to check an XML input if it is contained in this list or not: ``` <xsl:variable name="$country" select="Request/country" > <!-- now I need to declare the list of countries here --> <xsl:choose> <!-- need to check if this list contains the country --> <xsl:when test="$country='??????'"> <xsl:text>IN</xsl:text> </xsl:when> <xsl:otherwise> <xsl:text>OUT</xsl:text> </xsl:otherwise> </xsl:choose> ``` Note: I am using XSLT 1.0.