Subject: Re: [xsl] How recursively iterate over entire document? From: Dimitre Novatchev <dnovatchev@xxxxxxxxx> Date: Tue, 16 Aug 2005 20:17:06 +1000 |
On 8/12/05, Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> wrote: > It's in tracking the dependencies that I see the problems. > > If it can be mapped out, I don't think it's infeasible. And we know about > micropipelining in XSLT2 -- (I've even done it). What concerns me would be > tangling up what is supposed to happen when (or maybe, what would interest > me is how to express and manage the dependencies). FXSL handles this gracefully -- just use the f:compose-flist() function. An example of the usage of f:compose-flist() taken from its test testFunc-compose.xsl is the following: Multi Compose: (*3).(*2).(*3) 2 = <xsl:value-of select= "f:compose-flist((f:mult(3), f:mult(2), f:mult(3)), 2)"/> The above produces: 36 as one might expect. The first parameter must be a sequence of functions (template/function references). The second parameter is the initial argument on which the first function from the sequence is to be applied. There's absolutely no limitation on the functions except that the first should take an argument of the type of the initial argument and that the n-th function should take a single argument having the type of the result produced by the (n-1)th function. Opposite to the f:compose() function, f:compose-flist() applies the functions from left to right. This is *the universal* way to perform a sequence of operations in a desired order within a functional programming system. Cheers, Dimitre Novatchev --------------------------------------- Harry did not ask how Dumbledore knew; ...but Harry had long since learned that bangs and smoke were more often the marks of ineptitude than expertise.
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] How recursively iterate o, Wendell Piez | Thread | [xsl] Breaking from the for-each lo, Oleg Konovalov |
Re: [xsl] Problem using Key on mult, Sreenath Juluri | Date | Re: [xsl] ANN: XSLT 2.0 unit testin, Jeni Tennison |
Month |