xsl-list
[Top] [All Lists]

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

2021-05-14 08:35:39
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
Saxonica

On 14 May 2021, at 14:28, Graydon graydon(_at_)marost(_dot_)ca 
<xsl-list-service(_at_)lists(_dot_)mulberrytech(_dot_)com> wrote:

On Fri, May 14, 2021 at 01:05:31PM -0000, Michael Kay 
mike(_at_)saxonica(_dot_)com 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(_at_)gmail(_dot_)com
Þæs oferéode, ðisses swá mæg.
-- Deor  ("That passed, so may this.")


--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--


<Prev in Thread] Current Thread [Next in Thread>