xsl-list
[Top] [All Lists]

Re: [xsl] How to call an XSLT function whose name isn't known till run-time?

2019-12-06 17:50:50
Well, you can turn the function name into a function object using 
fn:function-lookup(), and then invoke it using dynamic function invocation, but 
one wonders why you are using function names as distinct from function objects 
in the first place. Where do these strings like "move" come from? It looks like 
a situation that's crying out for proper use of higher-order functions.

Michael Kay
Saxonica

On 6 Dec 2019, at 17:21, Costello, Roger L. costello(_at_)mitre(_dot_)org 
<xsl-list-service(_at_)lists(_dot_)mulberrytech(_dot_)com> wrote:

Hi Folks,

I have an XSLT variable, $function-to-invoke, that holds the name of an XSLT 
function to be invoked. For example, if $function-to-invoke holds the string 
"move" then I  want my XSLT program to invoke the function with that name, 
i.e., invoke f:move(...). Is there a way for XSLT to call a function whose 
name isn't known till run-time? 

/Roger

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