W3C home > Mailing lists > Public > public-xml-processing-model-wg@w3.org > February 2006

Re: The iterator case

From: Rui Lopes <rlopes@di.fc.ul.pt>
Date: Thu, 16 Feb 2006 21:07:29 +0000
Message-ID: <43F4E991.4020103@di.fc.ul.pt>
To: public-xml-processing-model-wg@w3.org, norman Walsh <Norman.Walsh@Sun.COM>


Norman Walsh wrote:
> Multiple inputs and multiple outputs lead immediately to the iterator
> case. I'm not sure what to do about that.
> 
> The use case:
> 
>   Run "xslt" over book.xml. This will produce ch1.html, ch2.html, ...
>   Run "tidy" over "ch1.html", "ch2.html", ...
> 
> The number (and name) of the outputs in step one depends on the input,
> and of course I want the pipeline to be reusable, so how do we do
> this?
> 
> One solution is to change the stylesheet so that it produces a single
> infoset:
> 
>   <c:chunks>
>     <html>...</html>
>     <html>...</html>
>     <html>...</html>
>   </c:chunks>
> 
> then you could say:
> 
>   <p:stage name="xslt">
>     <p:param name="stylesheet" href="..."/>
>   </p:stage>
>   <p:stage name="tidy"/>
>   <p:stage name="splitter"/>
> 
> But I'm not sure that's a practical solution.

I have the same feeling about splitting as the last operation. By having
  iteration sooner, optimizations can be made (e.g. parallel processing
of each iteration item).

> 
> Another idea is to say that each stage must report to the processor
> all of the infosets that it created. Then an iterator could be
> written.
> 
>   <p:stage name="xslt">
>     <p:param name="stylesheet" href="..."/>
>   </p:stage>
> 
>   <p:stage name="iterate" anonymous="no">
>     <p:stage name="tidy"/>
>   <p:stage>
> 
> Where the iterate stage applies the stages it contains to each of the
> outputs from the previous stage (optionally only the anonymous
> outputs) in turn and produces as its output a set of infosets.
> 

 From the example, what happens to the default output from the xslt? If
we want to continue its processing through the pipeline, should we
continue to specify the pipeline? Something like:

<p:stage name="xslt" />
<p:stage name="iterate" />
<p:stage name="xslt" /> <!-- this step processes the default output from
the first xslt step -->
....


> Bleh.

Ditto. :)


Rui


Received on Friday, 17 February 2006 08:40:13 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:21:47 GMT