Subject: Re: Functional programming in XSLT
From: "David Rosenborg" <david.rosenborg@xxxxxxxxxx>
Date: Mon, 12 Mar 2001 10:39:15 +0100
|
Hi Alexey,
> XSLT is frequently called a functional programming language. However,
> few important constructions common for functional languages are missing
> in XSLT.
>
> At my opinion, adding the following features to XSLT could make it more
> suitable for the functional programming.
>
>
> 1. Lambda-elements
> ------------------
[...]
You may want to have a look at
http://www.pantor.com/fxpath/
and
http://www.jenitennison.com/xslt/exslt/functions/
The documents describe two approaches to achive similar
functionality to your proposal. FXPath does this by extending
XPath and EXSLT by using XSLT instructions. However, none of these
documents inlcude a definition of how to use higher order functions
or treating functions as first class objects if you like.
In the discussions that lead to these documents, a couple of approaches to
call functions by name were brought up: different vairants of exsl:evaluate (string)
and exsl:apply (string, object ...). In the FXPath the notion of a function object
is introduced. This could easily be extended (as hinted in the first paragraph of
chapter 6) to use functions as first class objects. A fx:call (func, object, ....)
extension function would be needed, and the function definition expression
should be treaded as a primary expression. This would be easy to specify,
a bit harder to implement in the general case though (in the light of
current XSLT/XPath engines).
Cheers,
</David>
David Rosenborg
Pantor Engineering AB
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|