Re: Using xsl:apply-templates with xsl:with-param

Subject: Re: Using xsl:apply-templates with xsl:with-param
From: "Sebastian Rahtz" <sebastian.rahtz@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 15 May 2000 23:16:59 +0100 (BST)
Ron Ten-Hove writes:
 > How is xsl:with-param supposed to work from within an xsl:apply-templates
 > element?  The recommendation doesn't seem to actually spell it out, other
 > that saying it is allowed.  Consider the following:

...
 >             <xsl:apply-templates>
 >                 <xsl:with-param name="param">List</xsl:with-param>
 >             </xsl:apply-templates>
 >         </root>

if you say

  <xsl:apply-templates select="doc/chapter">

It has the result you expect. This is because the step from <root> to
<doc> to <chapter> is by separate (implicit) <xsl:apply-templates>
 rules, and the parameter is not passed through automatically. It
passes to the next level (when <doc> is processed), but there is no
reason for it to be passed by <doc> to <chapter>.

<xsl:apply-templates/> does not process all the descendants, despite
appearances. 

Sebastian Rahtz


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread