Re: [xsl] passing a function as a parameter to transform()

Subject: Re: [xsl] passing a function as a parameter to transform()
From: "Graydon graydon@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 14 May 2021 13:28:35 -0000
On Fri, May 14, 2021 at 01:05:31PM -0000, Michael Kay mike@xxxxxxxxxxxx scripsit:
> You're calling <xsl:sequence select="local:tiny('away')" />, but there is no function named local:tiny in scope. What there is is a variable (parameter) named local:tiny, whose value is a function. So you need a dynamic call on the function held in the variable, not a static call on a function named local:tiny(). That is, you need 
> <xsl:sequence select="$local:tiny('away')" />

I do, but that shifts the error to the xsl:param:

<xsl:param as="function(xs:string) as text()" name="local:tiny" />

give the error:

A value must be supplied for parameter $local:tiny because there is no default value for the required type

As noted to Martin, sticking an anonymous function in the select appears
to override the function being passed.  And would get really complicated
if this was a real function, so I am still baffled.

Static params -- $DEBUG -- allows setting "no" by default and having the
passed value override it, so I'm surprised.

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

Current Thread