[xquery-talk] Multiple output via a stream of filters
ihe.onwuka at gmail.com
Mon Jan 13 16:19:21 PST 2014
On Mon, Jan 13, 2014 at 11:54 PM, David Lee <dlee at calldei.com> wrote:
> If your running in exist then pure XQuery is probably as good or better then anything else.
> Could you expand on your problem ?
I have a collection. Suppose I have 10 different outputs I want and
the decision as to which output a node is routed to (not necessarily
mutual exclusive though) can be encapsulated in a predicate (hence
amenable to a filter HOF).
I only want to iterate over the collection once but I wish to apply
the 10 predicates to each node in the sequence so as to determine
which of the 10 outputs (again not necessarily mutually exclusive) the
node will feature in.
The algorithm is straightforward using structural recursion (or tail
recursion if tail call elimination is an issue). Asking whether there
is an idiomatic XQuery solution that is different from this.
More information about the talk