[closed] Re: Output from for-each that gets evaluated zero times

/ Norman Walsh <ndw@nwalsh.com> was heard to say:
| Consider the following step:
|
| <p:for-each>
|   <p:iteration-source>
|     <p:inline><doc1/></p:inline>
|     <p:inline><doc2/></p:inline>
|     <p:inline><doc3/></p:inline>
|   </p:iteration-source>
|   <p:output port="identity">
|   <p:output port="hello">
|     <p:inline>
|       <p>Hello World</p>
|     </p:inline>
|   </p:output>
|   <p:identity/>
| </p:for-each>
|
| I assume that the output on the 'identity' port is (doc1,doc2,doc3) and
| the output on the 'hello' port is three documents, each consisting of
| "<p>Hello World</p>"
|
| Right so far?
|
| Now consider this step:
|
| <p:for-each>
|   <p:iteration-source>
|     <p:empty/>
|   </p:iteration-source>
|   <p:output port="identity">
|   <p:output port="hello">
|     <p:inline>
|       <p>Hello World</p>
|     </p:inline>
|   </p:output>
|   <p:identity/>
| </p:for-each>
|
| What does it produce? I assume an empty sequence on both output ports, right?

Yes.

                                        Be seeing you,
                                          norm

-- 
Norman Walsh <ndw@nwalsh.com> | Everything should be made as simple as
http://nwalsh.com/            | possible, but no simpler.

Received on Friday, 8 February 2008 17:48:14 UTC