xsl-list
[Top] [All Lists]

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

2021-05-14 08:06:57
On Fri, May 14, 2021 at 12:39:53PM -0000, Martin Honnen 
martin(_dot_)honnen(_at_)gmx(_dot_)de scripsit:
Use $local:function

Progress!

If I invoke the passed-as-a-parameter function as

<xsl:sequence select="$local:tiny('away')" />

in the stylesheet called by transform(), it changes the error.

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

Engine name: Saxon-EE 10.3 (External)
Severity: error
Description: A value must be supplied for parameter $local:tiny because there 
is no default value for the required type

oXygen binds the error to the parameter definition in the called
stylesheet.

Putting a default value in the select attribute via an anonymous
function appears to override the passed-in function.  It also gets
impractically complex for a non-toy-example function, so that can't be
right.

required="no" does not help.  Removing the "as" attribute changes the
error to:

The required item type of the target of the dynamic function call is 
function(*); the supplied value "" is an atomic value

so I conclude that I can't have the param rely on the definition of
whatever function gets passed to it.

Trying to search for "function parameter" gets the parameters of
functions, rather than this case, so I haven't been able to find an
example.

Thank you!  being able to change the error produces hope.

-- 
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>