This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

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


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:

http://www.vbxml.com/downloads/default.asp?id=v2001611171627

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

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

http://sources.redhat.com/ml/xsl-list/2001-06/msg01147.html


A detaled explanation of generic templates can be found at:

http://lists.fourthought.com/pipermail/exslt/2001-May/000169.html

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


Hope this helped.

Cheers,
Dimitre Novatchev. 

__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]