I'm trying to replace an older perl-based program with xslt. Succinctly put, our docs are authored as composite works, which are split up according to *country code attributes* at run time. If an element doesn't have a country code, it's assumed that it applies to all countries. These country code values are held within semi-colon delimited values (if needed) within the attribute:

  <para id="d0e207" country.code="BA-CG;USAF-A;USAF-AM;USAF-C">Misc. information stuff.</para>
  <para id="d0e208" country.code="USAF-A">More content</para>

I pass the country code when the xslt is run, via a global param. I am attempting to use <xsl:analyze-string> to test for the existence of the string within the country.code attribute. Here's my template:

<xsl:template match="@*|element()">
  <xsl:when test="not(@COUNTRY.CODE)">
      <xsl:apply-templates select="@*|element()"/>
  <xsl:when test="self::*[@COUNTRY.CODE]">
    <xsl:variable name="ccValue">
      <xsl:value-of select="self::*/@COUNTRY.CODE"/>
   <xsl:analyze-string select="$ccValue" regex="/{$countryCode}\W/">
         <xsl:apply-templates select="@*|element()"/>
     <xsl:non-matching-substring><!-- do nothing --></xsl:non-matching-substring>

Passing in the countryCode value within curly-braces is not working. I've tried doubling the braces. Any suggestions?