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

Subject: Re: [xsl] passing a function as a parameter to transform()
From: "Michael Kay mike@xxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 14 May 2021 13:35:33 -0000
I can't see what's wrong at this stage, but that's probably because I'm not
sure exactly what your code looks like after a series of changes.

Clearly the "called" stylesheet isn't picking up the supplied value for the
parameter. I can't see why, but I would look carefully at the rather weird
namespace that it's using.

Michael Kay

> On 14 May 2021, at 14:28, Graydon graydon@xxxxxxxxx
<xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:
> On Fri, May 14, 2021 at 01:05:31PM -0000, Michael Kay mike@xxxxxxxxxxxx
>> 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
> CC&s oferC)ode, C0isses swC! mC&g.
> -- Deor  ("That passed, so may this.")

Current Thread