This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: parameter problem
- To: xsl-list at lists dot mulberrytech dot com
- Subject: Re: [xsl] parameter problem
- From: "Alexander Gutman" <gutman at novosoft-us dot com>
- Date: Fri, 3 Aug 2001 16:24:32 +0700
- Reply-To: xsl-list at lists dot mulberrytech dot com
Hello.
> <xsl:template match="para"><!--I am replacing "para" element by
"Praveg"-->
> <Praveg>
>
> <xsl:copy-of select="@*"/>
> <xsl:apply-templates/>
> </Praveg>
>
> </xsl:template>
>
> </xsl:transform>
>
> Now my problem is that I want to take the input regarding which element
to
> replace & by which element ,from user as parameters.I am facing problem
as I
> can't assign a parameter value to <xsl:template match> option .
> for eg <xsl:template match="{$foo}">.
<xsl:param name="element-name-to-replace"/>
<xsl:template match="*">
<xsl:choose>
<xsl:when test="local-name()=$element-name-to-replace">
<!-- replacement code -->
</xsl:when>
<xsl:otherwise>
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates/>
</xsl:copy>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
--
Alexander E. Gutman
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list