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

p:for-each

From: Norman Walsh <Norman.Walsh@Sun.COM>
Date: Sat, 29 Jul 2006 17:07:37 -0400
To: public-xml-processing-model-wg@w3.org
Message-ID: <87zmes15nq.fsf@nwalsh.com>
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 .../>

  { components }
</p:for-each>

The declare-input associates an input a local port name. (A for-each
must have exactly one p:declare-input.) In each iteration, that port
will provide the input for the loop. Components can read other
in-scope inputs as well.

If no select expression is provided, the loop will execute once for
each document in the document sequence identified by ref-each on the
input declaration.

If a select expression is provided, the loop will execute once for
each matching node(s) in each document in the document sequence
identified by ref-each on the input declaration.

The output(s) of each iteration will appear on the declared output
ports when the loop finishes.

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

                                        Be seeing you,
                                          norm

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

Received on Saturday, 29 July 2006 21:07:42 GMT

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