[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] dynamic template invocation


Subject: Re: [xsl] dynamic template invocation
From: ac <ac@xxxxxxxxxxxxx>
Date: Mon, 07 Sep 2009 22:15:44 -0400

Hi Dimitre,

It is a nice solution with a clever and elegant <xsl:variable name="templates" select="document('')/xsl:template" />

One can always pre-include the stylesheets into an integrated one, in a "pre-pass" to get access to the included/imported templates, which may not be so trivial especially for imported stylesheets.

The context also needs to be parametrized, but mostly it does not seem to provide dynamic template mode selection which brings back the requirement to use call-template on templates that typically have both name and match attributes, when running various process modes on the same source nodes (eg. payroll trial, log, post, archive, purge), either with as xsl:choose or a saxon:call-template.

There are different ways to get around the problem but none of them as elegant as <xsl:apply-templates mode="$mode"/> or variations thereof.

I have encountered quite a few other "similar" use cases, as when processing music, for example, with analysis, scoring, loging, debugging, performing modes, and for image and video processing, as well as for animation, case management, process modeling, ...

I was suggesting and wandering if others feel that it may be a natural and useful improvement for the standard.

What do you think?

Thank you.

Cheers,
ac


Search about FXSL. This feature is there (in  a way that is allowed by
the XSLT 1.0 language) since 2002.


Current Thread
Keywords