title: Update an XSLT to incorporate template calling
body: <p>I am editing an xslt in C#.
  It has a template "Get" defined in it.
  I want to call this template and pass it into a variable.</p>
  
  <p>Template: </p>
  
  <pre><code>&lt;xsl:template name="Get"&gt;
  
   &lt;xsl:param name="varMonth" /&gt;
    &lt;xsl:choose&gt;
        &lt;xsl:when test="$varMonth='JAN'"&gt;
          &lt;xsl:value-of select="'A'" /&gt;
        &lt;/xsl:when&gt;
   &lt;/xsl:choose&gt;
  &lt;/xsl:template&gt;
  </code></pre>
  
  <p>XSLT:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;
  &lt;xsl:template match="/"&gt;
  &lt;DocumentElement&gt;
    &lt;PositionMaster&gt;
          &lt;xsl:variable name="varName"&gt;
            &lt;xsl:value-of select="''" /&gt;
          &lt;/xsl:variable&gt;
    &lt;/PositionMaster&gt;    
  &lt;/DocumentElement&gt;
  &lt;/xsl:template&gt;
  
  &lt;/xsl:stylesheet&gt;
  </code></pre>
  
  <p>Code:
  I am getting a string as an input to the param of the template</p>
  
  <pre><code>string input = "A";
  XmlDocument xslDoc = new XmlDocument();
  xslDoc.Load("a.xslt");
  XmlNamespaceManager nsMgr = new XmlNamespaceManager(xslDoc.NameTable);
  nsMgr.AddNamespace("xsl", "http://www.w3.org/1999/XSL/Transform");
  XmlElement valueOf = (XmlElement)xslDoc.SelectSingleNode("/xsl:stylesheet/xsl:template[@match = '/']/DocumentElement/PositionMaster/xsl:variable[@name = "varName"]/xsl:value-of", nsMgr);
  
  if (valueOf != null)
  {
  // What should i write here to get the below modified XSLT
  }
  </code></pre>
  
  <p>Required XSLT:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;
   &lt;xsl:template match="/"&gt;
    &lt;DocumentElement&gt;
     &lt;PositionMaster&gt;
          &lt;xsl:variable name="varName"&gt;
             &lt;xsl:call-template name="Get"&gt;
               &lt;xsl:with-param name="Month" select="input"/&gt;
             &lt;/xsl:call-template&gt;
          &lt;/xsl:variable&gt;
     &lt;/PositionMaster&gt;    
    &lt;/DocumentElement&gt;
   &lt;/xsl:template&gt;
  &lt;/xsl:stylesheet&gt;
  </code></pre>