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

The iterator case

From: Norman Walsh <Norman.Walsh@Sun.COM>
Date: Thu, 16 Feb 2006 15:25:17 -0500
To: public-xml-processing-model-wg@w3.org
Message-ID: <8764nfxd8y.fsf@nwalsh.com>
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.

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.

This runs afoul of my immutability idea though, unless the iterator
has some way of changing the names.

I suppose it could always produce anonymous infosets and then the
problem of naming them is mine to solve (using a PI in each one or
something).

There's also the question of what it means for an iterator to produce
non-XML.

  <p:stage name="xslt">
    <p:param name="stylesheet" href="some-fo-stylesheet.xsl"/>
  </p:stage>

  <p:stage name="iterate" anonymous="no">
    <p:stage name="fotopdf"/>
  <p:stage>

Bleh.

                                        Be seeing you,
                                          norm

-- 
Norman.Walsh@Sun.COM / XML Standards Architect / Sun Microsystems, Inc.
NOTICE: This email message is for the sole use of the intended
recipient(s) and may contain confidential and privileged information.
Any unauthorized review, use, disclosure or distribution is prohibited.
If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.

Received on Thursday, 16 February 2006 20:25:38 GMT

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