[xsl] Re: Re: Designs for XSLT functions (Was: Re: RE: syntax sugar for call-template)

Subject: [xsl] Re: Re: Designs for XSLT functions (Was: Re: RE: syntax sugar for call-template)
From: Dimitre Novatchev <dnovatchev@xxxxxxxxx>
Date: Tue, 20 Feb 2001 12:02:45 -0800 (PST)
> > I personally think that a function for dynamic invocation of functions
> > would be more helpful.  Your method above is good because, as you say,
> > you can pass by position or by name (I'm not sure how you get the two
> > to mix - perhaps you can expand on that?).  This means that unlike the
> > method that Uche and I were talking about:
> > 
> >   exsl:call('my:func', 'Name1', Value1, 'Name2', Value2)
> > 
> > it could also be applied to existing XPath functions that do not have
> > a concept of 'named' arguments, only positional ones.  For example,
> > with your method you could do:
> > 
> >   x:fn('substring-before', '$string', '$char')
> > 
> > Whereas with the method Uche and I were talking about you'd be stuck.
> Well, not completely, but I admit that the work-around is hideous:
> exsl:call('concat', '', 'a', '', 'b', '', 'c')
> I guess I'm beginning to cave into the idea of

I'm glad that based on real examples you're beginning to appreciate the idea. 
What is important here is that a name-value pair is treated as one whole. 
This results in a natural, intuitive and flexible representation 
of the function call.

> exsl:call('my:func', 'Name1?Value1", 'Name2?Value2')
> Where "?" is to be replaced by some delimiter, perhaps space.

The following looks very straightforward:

 exsl:call('my:func', 'Name1=Value1", 'Name2=Value2')

Dimitre Novatchev.

Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Current Thread