Re: [xsl] XPath equivalent to xsl:apply-templates?

Subject: Re: [xsl] XPath equivalent to xsl:apply-templates?
From: "Michael Kay mike@xxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 13 Jun 2022 13:55:33 -0000
I agree a functional equivalent to apply-templates would be useful.

In trying to design it, the main stumbling block has been how to handle modes.
We could make the mode-name a dynamically-defined QName argument, but that's
then a new capability (dynamic modes) rather than a functional equivalent, and
it raises questions in the context of 3.0 mode visibility and packages.

An alternative design would be to use the mode name as the function name, or
to find some other way of statically associating a function with a specific
mode.

Michael Kay
Saxonica


> On 13 Jun 2022, at 14:32, Chris Papademetrious
christopher.papademetrious@xxxxxxxxxxxx
<xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:
>
> Hi Graydon, Dimitre,
>
> I have also wished for the ability to apply templates from XPath. I don't
think it's so much about solving a problem that <xsl:apply-templates> can't;
it's more a matter of convenience in some cases. A function wrapper around the
template works, but it would be nice to more directly (and more clearly)
invoke the template itself.
>
> As an XSLT novice, I struggle to see transparently through some of the
verbosity that more experienced developers can. Anything that helps reduce
verbosity helps me keep things in my head.
>
> - Chris

Current Thread