@select on p:for-each redundant?

I think @select on p:for-each is unnecessary and potentially
confusing. Am I forgetting something?

I believe that these two steps are entirely equivalent:

  <p:for-each select="//div">
    <p:iteration-source>
      <p:pipe step="somewhere" port="something"/>
    </p:iteration-source>
    ...
  </p:for-each>

and

  <p:for-each>
    <p:iteration-source select="//div">
      <p:pipe step="somewhere" port="something"/>
    </p:iteration-source>
    ...
  </p:for-each>

And so are these two, I think:

  <p:for-each select="//div">
    ...
  </p:for-each>

and

  <p:for-each>
    <p:iteration-source select="//div"/>
    ...
  </p:for-each>

Even this for-each:

  <p:for-each select="/chapter">
    <p:iteration-source select="//book"/>
    ...
  </p:for-each>

can be rewritten without the double-use of select:

  <p:for-each>
    <p:iteration-source select="//book/chapter"/>
    ...
  </p:for-each>

Is there any reason to keep select in both places? Can we remove it
From p:for-each?

If we don't want to remove it from p:for-each, can we at least say
that its semantics are that it contributes to the set of documents
that appear on the input to the for-each?

What I mean is, given a default readable port on which three documents
appear which contain a total of five divs amongst them, I don't want
the semantics of this step:

  <p:for-each select="//div">
    ...
  </p:for-each>

to be that it runs five times processing three documents. I want it to
have the semantics that it processes five documents.

                                        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 Wednesday, 6 June 2007 16:17:42 UTC