title: How to call named templates based on a variable?
body: <p>I don't know if it's possible, but I'm wondering how to do it...</p>
  
  <p>Let's say we have the following XSL:</p>
  
  <pre><code>&lt;xsl:template name="foo"&gt;
    Bla bla bla
  &lt;/xsl:template&gt;
  ...
  &lt;xsl:template name="bar"&gt;
    Bla bla bla
  &lt;/xsl:template&gt;
  ...
  &lt;xsl:template match="/"&gt;
    &lt;xsl:if test="$templateName='foo'"&gt;
      &lt;xsl:call-template name="foo"/&gt;
    &lt;/xsl:if&gt;
    &lt;xsl:if test="$templateName='bar'"&gt;
      &lt;xsl:call-template name="bar"/&gt;
    &lt;/xsl:if&gt;
  &lt;/xsl:template&gt;
  </code></pre>
  
  <p>Is it possible to change the XSL to read something like...</p>
  
  <pre><code>&lt;xsl:template match="/"&gt;
    &lt;xsl:call-template name="$templateName"/&gt;
  &lt;/xsl:template&gt;
  </code></pre>