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>


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="..."
   <p:for-each-output name="sequence-of-errors" ref="error"/>

    Steps with references to source-document and declaring the name error

> (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.

Blog (XML, Web apps, Open Source):
Received on Thursday, 3 August 2006 01:30:47 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:32:40 UTC