xsl-list
[Top] [All Lists]

need a variable path in the template-match attribut

2002-11-26 06:48:00
Hello!

I need an XSLT which copies all nodes to a new XML, but one tag needs to be
changed. This should be done with a variable because I want to use it in
Apache Cocoon and want to call the stylesheet with a parameter like this:
http://localhost:8080/cocoon/edit?mypath=//ad/new

<xsl:param name="mypath"/>
<xsl:template match="@*|node()">
        <xsl:copy>
          <xsl:apply-templates select="@*|node()"/>
        </xsl:copy>
</xsl:template>
<xsl:template match="$mypath">
        <xsl:copy>New Text Here</xsl:copy>
</xsl:template>

I know that I can't use variable-references in the match attribut in
templates. But I think this should be possible in some way ;)
Thanks for your help!
Markus Karsch

-- 
+++ GMX - Mail, Messaging & more  http://www.gmx.net +++
NEU: Mit GMX ins Internet. Rund um die Uhr für 1 ct/ Min. surfen!


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



<Prev in Thread] Current Thread [Next in Thread>