[xquery-talk] Multiple output via a stream of filters

Ihe Onwuka ihe.onwuka at gmail.com
Mon Jan 13 11:11:22 PST 2014


I am running through about a gigabyte worth of xml documents.

The ideal processing scenario is to offer each node in the sequence to
a list of filters and augment  different XML documents  (or different
branches of one encompassing document) based on the outcome of the
filter.

If anyone has seen the example used to illustrate continuation passing
style in Chapter 8 of the Little Schemer that is exactly what I have
in mind  (albeit not necessarily in continuation passing style).

What I am doing at the moment is cycling through the nodes n times
where n is the number of filters I am applying. Clearly sub-optimal.
However it is not a priority to what I am actually doing (which is
simply to get the result rather than to do so performantly) so I am
not quite motivated enough to figure out how to do this.

Hence I am asking instead what others have done in a similar scenario.
I suppose some sort of customised HOF  entailing head/tail recursion
over the sequence and accepting a list of filter functions, would  be
the likely form a solution would take.


More information about the talk mailing list