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

Re: p:for-each

From: Alessandro Vernet <avernet@orbeon.com>
Date: Wed, 2 Aug 2006 18:30:42 -0700
Message-ID: <4828ceec0608021830y665a8f73jd8457ed77665b1d1@mail.gmail.com>
To: public-xml-processing-model-wg <public-xml-processing-model-wg@w3.org>

Norm,

On 7/29/06, Norman Walsh <Norman.Walsh@sun.com> wrote:
> p:for-each iterates over a document sequence or the nodes matched
> by an XPath expression in a document sequence.
>
> <p:for-each name="QName">
>   <p:declare-input ref-each="reference" select="//..." .../>
>   <p:declare-output .../>

Any reason why you are using 'ref-each' for the attribute name instead
of 'ref' here?

Also, note the difference between your <p:declare-input> in the
<p:for-each> and the <p:declare-input> in the <p:pipeline>. The former
reads from somewhere and declares a name that can be referenced inside
the <p:for-each>. The later only provide a name that be referenced
inside the pipeline.

The input of <p:for-each> reads from somewhere like a step input and
declares a name like a pipeline declare-input. It does both and is not
exactly the same as any of those. IMHO it would be wise to choose an
element name that is different from <p:declare-input> and <p:input> to
avoid the confusion, e.g.:

<p:for-each >
   <p:for-each-input ref="documents-to-import" select="..."
name="source-document"/>
   <p:for-each-output name="sequence-of-errors" ref="error"/>

    Steps with references to source-document and declaring the name error
</p:for-each>

> (I don't think there's consensus on combining loop-over-these-nodes
> and loop-over-these-documents, but personally I think the semantics
> I've described are reasonable and easy to understand.)

I agree and also think combining the loop-over-these-nodes and
loop-over-these-documents is a good idea.

Alex
-- 
Blog (XML, Web apps, Open Source):
http://www.orbeon.com/blog/
Received on Thursday, 3 August 2006 01:30:47 GMT

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