The sample which I have which uses a context variable is
<?xml version="1.0" encoding="UTF-8"?>
<xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<xsl:param name="authenticatedUser.foo" select="'foo attribute not available'"/>
<!-- add the element at the end of the headers -->
<xsl:template match="//soap:Envelope/soap:Header/*[last()]">
<xsl:copy>
<xsl:apply-templates select="node()|@*" />
</xsl:copy>
<xsl:call-template name="tokenize-1">
<xsl:with-param name="pat" select="$authenticatedUser.foo"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="node()|@*" />
</xsl:copy>
</xsl:template>
<xsl:template name="tokenize-1">
<xsl:param name="pat"/>
<xsl:choose>
<xsl:when test="contains($pat,',')">
<xsl:call-template name="process-token">
<xsl:with-param name="token" select="substring-before($pat,',')"/>
</xsl:call-template>
<xsl:call-template name="tokenize-1">
<xsl:with-param name="pat" select="substring-after($pat,',')"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="process-token">
<xsl:with-param name="token" select="$pat"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="process-token">
<xsl:param name="token"/>
<foo><xsl:value-of select="$token"/></foo>
</xsl:template>
</xsl:transform>
I did get your xsl reviewed by my team. It seems you cannot use a context variable in the match parameter it will need to be a static entry.