Subject: Re: [xsl] Re: Call Template with variable name From: Eric van der Vlist <vdv@xxxxxxxxxxxx> Date: Sat, 13 Oct 2001 19:45:53 +0200 |
"Yash" <yashdeep at ekartha dot com> wrote:
Why is there a syntax problem with the following: <xsl:call-template name="$abc"/> i.e. is there a way to call a template whose name is specified with the variable 'abc'?
No -- not in XSLT 1.0 and probably not in XSLT 2.0 judging from the working draft I've seen.
However, almost the same effect can be accomplished using the mechanism of generic templates, as described in:
http://lists.fourthought.com/pipermail/exslt/2001-May/000169.html
<!-- hooks --> <vn:templates> <vn:template1/> <vn:template2>I am template 2</vn:template> <vn:template3> <info> Some more info for template 3</info> <vn:template3> </vn:templates>
<xsl:apply-templates select="$varnames/*[local-name()=$abc]"> <xsl:with-param name="context" select="."/> </xsl:apply-templates>
<xsl:template match="vn:template1"> ...
Eric -- Rendez-vous à Paris pour une visite guidee de la nebuleuse XML. http://dyomedea.com/formation/ ------------------------------------------------------------------------ Eric van der Vlist http://xmlfr.org http://dyomedea.com http://xsltunit.org http://4xt.org http://examplotron.org ------------------------------------------------------------------------
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Re: Call Template with variab, Dimitre Novatchev | Thread | [xsl] Re: Re: Re: Call Template wit, Dimitre Novatchev |
Re: [xsl] keys and idrefs - XSLT2 r, Mulberry Technologie | Date | [xsl] Re: Re: Re: Call Template wit, Dimitre Novatchev |
Month |