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

Subject: Re: [xsl] XPath equivalent to xsl:apply-templates?
From: "Graydon graydon@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 14 Jun 2022 12:26:45 -0000
On Tue, Jun 14, 2022 at 11:50:05AM -0000, Chris Papademetrious christopher.papademetrious@xxxxxxxxxxxx scripsit:
> Hi Graydon,

Hello Chris --

> > Do we want to emulate a template entirely in a function or have a function that allows XPath to either call or apply templates?
> 
> Definitely the latter!

But we don't mean, for apply-templates, any specific template; we mean
"take this sequence of nodes and figure out which template should
apply, just as in xsl:apply-templates", so we have to handle mode and
priority.

It could be fn:perform-template-matching($nodeSet,$mode,$priority) and
it wouldn't work in XQuery.

Similarily it could be fn:apply-named-template($templateName,$contextItem) and it still wouldn't work in XQuery.

There is no obvious reason -- other than the effort and sanity of the
implemetors -- there couldn't be a template-function derivative of the
base function type, and those have the mode component of the arity.  But
that is not so much a feature as a new language that goes
one-ring-to-rule-them-all on XPath, XQuery, and XSLT.

-- 
Graydon Saunders  | graydonish@xxxxxxxxx
^fs oferiode, pisses swa mfg.
-- Deor  ("That passed, so may this.")

Current Thread