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

Re: For-each question

From: Alex Milowski <alex@milowski.org>
Date: Sun, 23 Jul 2006 14:20:45 -0700
Message-ID: <44C3E82D.8070007@milowski.org>
To: public-xml-processing-model-wg@w3.org

Norman Walsh wrote:
> / Alex Milowski <alex@milowski.org> was heard to say:
> | I'd call this an error.  The for-each is like a mini-pipeline and
> | needs to have that extra input declared:
> 
> Well, Jeni argued against that requirement.

Hmm... I guess I need to be refreshed of the reasons why we
wouldn't do this.

> 
> | <p:for-each select="//chapter" ref="#valid/result" name="loop">
> |     <p:declare-input port="#build-stylesheet/result"
> |                      name="the-stylesheet"/>
> |     <p:declare-output port="result" name="chapter-docs"/>
> |
> |     <p:step kind="transform" name="makehtml"/>
> |       <p:input port="document" ref="#loop/#matched"/>
> |       <!-- somehow we have to expose the matched regions as documents;
> |            here I'm imagining that for-each always declares a magically
> |            named input port which will be used for that purpose -->
> |       <p:input port="stylesheet" ref="the-stylesheet"/>
> |       <p:output port="result" ref="#loop/chapter-docs"/>
> |     </p:step>
> |   </p:for-each>
> 
> But even in this case, does each iteration get a copy of the whole
> #build-stylesheet/result ne the-stylesheet document?

I would say it needs to have the equivalent of the same infoset each
time.  If an implementation needs to make a copy to guarantee that
is true, then it should.  That is, smart optimizations should be
allowed.

--Alex Milowski
Received on Sunday, 23 July 2006 21:20:59 GMT

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