You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by Tory Toupin <tt...@PetroleumPlace.com> on 2000/10/16 21:22:52 UTC

xml:with-param

This is a largely usage question, but after digging around in the guts of
Xalan, I'm thinking it might be an "issue."

Here's the scenario.  With Xalan, I cannot consistently use with-param to
pass parameters to templates (whether through apply-templates or
call-template).  It seems that whenever I use with-param to apply-template
or call-template inside a for-each type block, the with-param parameters are
"blocked" (by the contextMarker) from the called context.  Something really
simple like this

	<xsl:template match="include" mode="html">
	<xsl:apply-templates select="document(@href)" mode="html/include">
		<xsl:with-param name="href" select="@href"/>
	</xsl:apply-templates>
	</xsl:template>

	<xsl:template match="html" mode="html/include">
	<xsl:param name="href"/>
	(From <xsl:value-of select="$href"/>.)
	<xsl:apply-templates select="body/*|body/text()" mode="html"/>
	</xsl:template>

	<xsl:template match="*|text()" mode="html/include"></xsl:template>

doesn't work.  If I change the code in such a way that there is no select,
the called context can see the with-param parameters; adding the select back
in causes the blockage.

Thoughts?

Tory Stephen Toupin
E-Mail: ttoupin@PetroleumPlace.com