title: Why can't I get parameters to work with apply-templates in XSL?
body: <p>I am finding it impossible to get with-param to work with apply-templates. As an example, I've hacked the examples given in <a href="http://www.w3schools.com/xsl/xsl_apply_templates.asp" rel="noreferrer">w3schools</a>.</p>
  
  <p>xsl</p>
  
  <pre><code>&lt;xsl:template match="/"&gt;
    &lt;xsl:apply-templates&gt;
      &lt;xsl:with-param name="test" select="'has this parameter been passed?'"/&gt;
    &lt;/xsl:apply-templates&gt;
  &lt;/xsl:template&gt;
  
  &lt;xsl:template match="cd"&gt;
    &lt;xsl:param name="test"&gt;&lt;/xsl:param&gt;
    parameter:
    &lt;xsl:value-of select="$test"&gt;&lt;/xsl:value-of&gt;
  &lt;/xsl:template&gt;
  </code></pre>
  
  <p>xml</p>
  
  <pre><code>&lt;catalog&gt;
    &lt;cd&gt;
      &lt;title&gt;Empire Burlesque&lt;/title&gt;
      &lt;artist&gt;Bob Dylan&lt;/artist&gt;
      &lt;country&gt;USA&lt;/country&gt;
      &lt;company&gt;Columbia&lt;/company&gt;
      &lt;price&gt;10.90&lt;/price&gt;
      &lt;year&gt;1985&lt;/year&gt;
    &lt;/cd&gt;
    &lt;cd&gt;
      &lt;title&gt;Hide your heart&lt;/title&gt;
      &lt;artist&gt;Bonnie Tyler&lt;/artist&gt;
      &lt;country&gt;UK&lt;/country&gt;
      &lt;company&gt;CBS Records&lt;/company&gt;
      &lt;price&gt;9.90&lt;/price&gt;
      &lt;year&gt;1988&lt;/year&gt;
    &lt;/cd&gt;
  &lt;/catalog&gt;
  </code></pre>
  
  <p>(Hopefully) you'll see that the test parameter is not being passed to the cd template. I can get it to work when using call-template, but not apply-templates. What's going on? I am using XSL 1.0. Please ignore the fact that I'm passing a hard-coded parameter - this is just an example.</p>