This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: problem with Passing Parameters to Templates
- To: xsl-list at lists dot mulberrytech dot com
- Subject: Re: [xsl] problem with Passing Parameters to Templates
- From: David Carlisle <davidc at nag dot co dot uk>
- Date: Mon, 22 Jan 2001 15:58:55 GMT
- References: <F208NYhxjtX5igRFHzF00003d9e@hotmail.com>
- Reply-To: xsl-list at lists dot mulberrytech dot com
<xsl:if test="$node-element">
<xsl:value-of select="$node-element" />
</xsl:if>
again, a spurious if. You _never_ need do that. The above is
equivalent to
<xsl:value-of select="$node-element" />
<xsl:template name="opt_template">
<xsl:param name="node"></xsl:param>
<xsl:variable name="node-element"
select=".//*[local-name() = $node]" />
<xsl:if test="$node-element">
<xsl:value-of select="$node-element" />
</xsl:if>
</xsl:template>
is just
<xsl:template name="opt_template">
<xsl:param name="node"/>
<xsl:value-of select=".//*[local-name() = $node]" />
</xsl:template>
David
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list