EDIT
After reading the post again, I think the original version of my answer (below) is wrong.
You already have a list - a variable declaration selects node-set of all <country> nodes that are children of <Request> (a node -set is the XSLT equivalent for an array / list)
<xsl:variable name="$country" select="Request/country" >
But the fact is that you do not need this list as a separate variable; anything you need:
<xsl:when test="Request[country=$country]"></xsl:when>
Where Request[country=$country] reads "Inside the <Request> , look at each <country> and select it if it is equal to $country ." When the expression returns a non-empty node -set, $country is in the list.
This, in fact, is what Rubens Farias said from the very beginning. :)
Original response saved for recording.
If by βlistβ you mean a string of tokens, separated by commas:
<xsl:variable name="countries" select="'EG, KSA, UAE, AG'" /> <xsl:variable name="country" select="'KSA'" /> <xsl:choose> <xsl:when test=" contains( concat(', ', normalize-space($countries), ', ') concat(', ', $country, ', ') ) "> <xsl:text>IN</xsl:text> </xsl:when> <xsl:otherwise> <xsl:text>OUT</xsl:text> </xsl:otherwise> </xsl:choose>
Tomalak
source share