Re: p:for-each

/ Norman Walsh <Norman.Walsh@Sun.COM> was heard to say:
[...]
| I would really like to avoid having a whole bunch of different flavors
| of input/output or declare-input/declare-output if we can avoid it.

This, for example, looks entirely reasonable to me:

<p:for-each name="loop">
  <p:declare-input port="input" ref="#some/input" select="//chapter"/>
  <p:declare-output port="result"/>

  <p:step kind="foobar">
    <p:input port="input" ref="#loop/input"/>
    <p:output port="result" ref="#loop/result"/>
  </p:step>
</p:for-each>

I'd say that in a for-each, there must be exactly one declare-input
and in a for-each (and only a for-each), it may have a select
attribute.

If the select is given, then what appears on the declared input port
is all the nodes that match that select expression in all the
documents in the referenced input.

If the select isn't given, then what appears on the declared input
port is each document in the referenced input.

                                        Be seeing you,
                                          norm

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

Received on Thursday, 27 July 2006 14:45:58 UTC