[xsl] Re: Re: variable definition reuse

Subject: [xsl] Re: Re: variable definition reuse
From: Dimitre Novatchev <dnovatchev@xxxxxxxxx>
Date: Fri, 22 Mar 2002 11:10:48 -0800 (PST)
> > 1. it is possible to do define element specific variables in a
> > different file??
> 
> Not through XSLT means. By definition, element-specific variables are
> local to the place where you're processing the element. The only
> variables that you can share across stylesheets are global variables.
> If you were only interested in (for example) the exp-date element
> child of the first Product in your file, then it would be fine.
> 
> You could, however, do this through entities.

Hi Jeni,

A better approach is to treat the template that processes a specific
node as function and to produce a partial application of this function,
in which a number of parameters have been bound to specific values.
This bindings will remain through the lifetime of the partial
application (an RTF) and will be in place every time it is
instantiated.

I think this is very close to (or maybe exactly) what Laura wishes to
have.

Also note, that the binding are produced at runtime and could be
dynamic, depending on specific conditions that are unknown in advance.
This is another advantage over the entities approach.

I think that using a partial application of a function is a complete
and better solution to the so called "dynamic scoping" problem.

Currying and partial application are available as part of the FXSL
functional programming library.

Cheers,
Dimitre Novatchev.


__________________________________________________
Do You Yahoo!?
Yahoo! Movies - coverage of the 74th Academy Awards®
http://movies.yahoo.com/

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


Current Thread