DuCharme, Bob
At XSLT 1.0, if a built-in template rule was invoked with
parameters, the parameters were not passed on to any templates invoked
by the built-in rule. At XSLT 2.0, these parameters are passed through
the built-in template rule unchanged. using this input document <a><b><c/></b></a>
and this stylesheet:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="2.0">
<xsl:output omit-xml-declaration="yes"/>
<xsl:template match="a">
<xsl:apply-templates>
<xsl:with-param name="flavor">mint</xsl:with-param>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="c">
<xsl:param name="flavor">vanilla</xsl:param>
Today's flavor: <xsl:value-of select="$flavor"/>
</xsl:template>
</xsl:stylesheet>
The output indicated that the $flavor value of "mint" had been passed. |