Re: p:for-each

/ Alessandro Vernet <avernet@orbeon.com> was heard to say:
| On 7/19/06, Norman Walsh <Norman.Walsh@sun.com> wrote:
|> A for-each looks like:
|>
|>   for-each := ($over, $select?, $label, with-output, {body})
|
| Norm,
|
| In your proposed syntax, the 3 attributes related to the input are on
| <p:for-each>, while the attributes related the output are on an inner
| element <p:with-output>.
|
| I think that having attributes related to the input directly on the
| <p:for-each> but having attributes related to the output on an inner
| element is somewhat inconsistent. So I suggest we use 2 inner
| elements.

That's a good point. Because I had 'select' as an attribute it made
sense to me to have 'over' (or 'from' if you prefer) as an attribute.
But we could do

  for-each := ($select, $label, with-input, with-output, { body })

I suppose we could even say:

  for-each := ($select, input, with-input, with-output, { body })

but that might be more confusing rather than less.

| Also, just as we like to have a <p:with-output> which has a different
| element name than the pipeline <p:output>, I suggest we used different
| element names here: <p:for-each-input> and <p:for-each-output>. This
| makes it clear that a <p:for-each-input> is an input, but not exactly
| like the <p:input> and <p:with-input> (all those elements also accept
| different set of attributes).
|
| That gives:
|
| <p:for-each>
|   <p:for-each-input from="documents-to-import"
|           select="/xpath"
|           label="one-document"/>
|   <p:for-each-output label="sequence-of-errors"
|           from="error-for-this-document"/>

I see your point, but I'm not yet convinced. Given that for-each-input
can only occur inside a for-each, it seems entirely reasonable to me
to use the same element name ("input") and allow the context to
influence its definition.

                                        Be seeing you,
                                          norm

-- 
Norman Walsh
XML Standards Architect
Sun Microsystems, Inc.

Received on Thursday, 20 July 2006 14:32:06 UTC