[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: How recursively iterate over entire document?

Subject: Re: How recursively iterate over entire document?
From: Dimitre Novatchev <dnovatchev@xxxxxxxxx>
Date: Tue, 16 Aug 2005 20:17:06 +1000
Re:  How recursively iterate over entire document?
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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.