[xsl] Re: keys fast for lookups? attribute-value template in xsl:call-template?

Subject: [xsl] Re: keys fast for lookups? attribute-value template in xsl:call-template?
From: Dimitre Novatchev <dnovatchev@xxxxxxxxx>
Date: Fri, 3 Aug 2001 21:18:28 -0700 (PDT)
Mike Lamb wrote:

[snip] -- David Marstone provided an excellent explanation for the first question.

> Second problem is that, after I retrieve the dealercode, I need to run a
> dealer specific template. I had tried to do this using xsl:call-templates as
> follows:
> <xsl:call-template name="DEALER{$DEALERCODE}"/>
> with no success.  Looks like the name attribute of xsl:call-template does
> not expect an attribute-value template. Any thoughts on how I might get this
> done? I am trying to avoid writing the huge switch statement over
> dealercode.

You cannot pass/have the name of the xsl:call-template in a variable to be
dynamically established -- this is because a QName must be specified and QNames are
just literal strings (static).

However, you can use a generic template -- the idea behind generic templates is
exactly to be able to dynamically instantiate a template, which is not known (even
may not be written yet) at the time of writing the generic template.

Useful examples of generic templates may be downloaded at:


This download contains four generic templates: min(), max(), binSearch(), sort().

Another generic template -- for multipass processing was posted in this list:


A detaled explanation of generic templates can be found at:


and in some of my replies to questions in this list.

Hope this helped.

Dimitre Novatchev. 

Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger

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

Current Thread