--- "Rotkop, Eugene" <Eugene dot Rotkop at gs dot com> wrote:
I was wondering if there is a way to store template name in the
then call template.
So, the sample XSL would be following:
<xsl:variable name="currentTemplate" select="'test'"/>
Seems like XSLT does not allow this. Am I using the wrong syntax? Can
be achieved in any other way?
The reason I am asking about this is that I am trying to use multiple
templates to create
header, body and footer for a web page. Header and footer stays the
all the pages. However,
body always changes. If I assign template names to header, footer and
I can call them to apply these templates.
I want to be able to call diffent body templates depending on the
Any help would be appreciated.
What you want to do is possible in another way by using a template
reference to a template (that must match the reference and need not be
This approach is in the base of the whole XSLT 1.0 functional
programming library FXSL.
A number of articles about FXSL and functional programming in XSLT 1.0
are available at:
I'd recommend specifically the first and second article (in that
order), which introduce the most basic concepts of higher-order
functions and provide the implementation of the most generic design
patterns -- folds (primitive recursion) over lists, strings and trees,
maps, iteration, currying and partial application.
The FXSL library contains useful functions for:
- calculating various math functions and their inverse (e.g.
trigonometric, hyperb.trigonometric, exponential, logarithmic,... etc)
and for solving equations of one real variable, numerical
differentiation and integration.
- random number generator, generating numbers according to
pre-defined distribution, randomising a list.
- various text-processing -- tokenizing, text justification, spelling
checking/correction and generation of close words.
The FXSL library has three different editions, which support MSXML,
XALAN and SAXON. It can be downloaded at:
http://fxsl.sourceforge.net/ -- the home of FXSL
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list