- From: Innovimax SARL <innovimax@gmail.com>
- Date: Mon, 14 May 2007 23:20:12 +0200
- To: "Norman Walsh" <ndw@nwalsh.com>
- Cc: public-xml-processing-model-wg@w3.org
On 5/14/07, Norman Walsh <ndw@nwalsh.com> wrote: > / "Innovimax SARL" <innovimax@gmail.com> was heard to say: > | On 5/14/07, Norman Walsh <ndw@nwalsh.com> wrote: > |> | > |> | If $p:position is always 1, why have $p:position? > |> > |> Position is always 1 in for-each and viewport because they're odd cases. > |> Consider this example instead: > | > | Ok p:viewport can accept only one document as input > | > | But that's not the case for for-each ! > > You can never read a sequence of documents from the 'current' port > inside a for-each, can you? I don't think you can, so the p:position is > always "1". > > | As you can see it in this thread, I proposed that $p:position is equal > | to the position of the document extract in the source sequence > > That makes p:position exactly the same as p:for-each_index, right? We need more information A for each takes a sequence as input For each document of the sequence, it try to apply the select if any so for each match beeing made available on the 'current' port we have two information The position of the match in the list of all the match (it was p:my_for-each_index) and the position of the fragment from the point of view of the source sequence This way : example ( <root> <b att="1"/> </root> , <root> <b att="2"/> <b att="3"/> </root> ) in <p:for-each select="//b" name="for-each"> </p:for-each> you will have in current consecutively <b att="1"/> with $p:position == 1 and p:for-each_index == 1 then <b att="2"/> with $p:position == 2 and p:for-each_index == 2 then <b att="3"/> with $p:position == 2 and p:for-each_index == 3 Mohamed -- Innovimax SARL Consulting, Training & XML Development 9, impasse des Orteaux 75020 Paris Tel : +33 8 72 475787 Fax : +33 1 4356 1746 http://www.innovimax.fr RCS Paris 488.018.631 SARL au capital de 10.000 €
Received on Monday, 14 May 2007 21:20:15 UTC