You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Peter Snellman <pe...@cinnober.com> on 2000/07/13 16:19:08 UTC

Problem using xsl:with-param

Hello,

We have noticed that a xsl:with-param under certain circumstances is not
propagated into the activated template.
There is different behaviour if the apply-template rule is written as
"TESTDATA" or "TESTDATA/*".

Why does this happen?


EXAMPLE

The resulting text is:

        TESTDATA: dex =
        TESTDATA: dex = Param passed

When the following xsl-code:
	
	<xsl:template match="TESTDATA[@value='kaka']/ALLAN">
		<xsl:param name="dex"/>
		TESTDATA: dex = <xsl:value-of select="$dex"/>
	</xsl:template>

	<xsl:template match="/ROOT">
		<!-- This parameter is not passed -->
		<xsl:apply-templates select="TESTDATA">
			<xsl:with-param name="dex" select="''Param not
passed'"/>
		</xsl:apply-templates>

		<!-- This parameter is passed -->
		<xsl:apply-templates select="TESTDATA/*">
			<xsl:with-param name="dex" select="'Param passed'"/>
	</xsl:apply-templates>

operates on the following XML input:

	<ROOT>
	  <TESTDATA value="kaka">
	    <ALLAN/>
	  </TESTDATA>
	</ROOT>	

Best Regards,

Peter Snellman
Cinnober Financial Technology AB
Stockholm, Sweden