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

Subject: RE: [xsl] keys fast for lookups? attribute-value template in xsl:call-template?
From: Dimitre Novatchev <dnovatchev@xxxxxxxxx>
Date: Mon, 6 Aug 2001 07:26:13 -0700 (PDT)
Mark Feblowitz wrote:

> If you're using Saxon, there's a way to allow the use of a variable in a
> template name:
> 
> saxon:allow-avt	This attribute may be set on the xsl:call-template element.
> If set to the value "yes", it causes the name attribute of xsl:call-template
> to be interpreted as an attribute value template. This allows the selection
> of the called template to be decided at run-time. Typical usage
> is:[NL]<xsl:call-template name="{$tname}" saxon:allow-avt="yes">
> 
> Don't forget to define the saxon namespace.

Also don't forget that by using such an extension you are writing non-portable XSLT
code that will not run on any other XSLT processor!

There is a 100% pure XSLT way to achieve this and it is by using the mechanism of
generic templates.

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


Current Thread