W3C home > Mailing lists > Public > www-forms-editor@w3.org > August 2002

Re: [long] nested repeats and index()

From: Mikko Honkala <honkkis@tml.hut.fi>
Date: Tue, 27 Aug 2002 16:40:47 +0300
Message-ID: <3D6B815F.3020706@tml.hut.fi>
To: Jérôme Nègre <jerome.negre@e-xmlmedia.fr>
CC: "www-forms-editor@w3.org" <www-forms-editor@w3.org>

Hi,

the inner nested repeat's cursor should be re-initialized to point to 
the first item to avoid error situations, as you point out. In your 
example, the index('repeatBookmarks') should return 1 after the addition 
of a new section, in order to make setValue work.

So maybe 9.3.5 - 3 should be updated from
"3.Finally, the cursor for any repeating sequence that is bound to the 
homogeneous collection where the node was added is updated to point to 
the newly added node."

to something like

"3.Finally, the cursor for any repeating sequence that is bound to the 
homogeneous collection where the node was added is updated to point to 
the newly added node. The cursors for inner nested collections are 
re-initialized to point at the head of the collection."
"

By the way, this applies also to 9.3.6 -3. (delete) and 9.3.7, 
(setindex) when applied to outer repeats.

-mikko


Jérôme Nègre wrote:
> 
> Hi,
> 
> I think that the behaviour of index() and nested repeats isn't well 
> defined in the latest draft.
> 
> ... [long example by Jérôme ]
> index('repeatSections') now returns 2, index('repeatBookmarks') still 
> returns 2.
> 
> However, the Xpath expression 
> section[index('repeatSections')]/bookmark[index('repeatBookmarks')] does 
> not point to an existing element, so trying to use a <setvalue> on the 
> new node would fail.
> 
> Is this interpretation the correct one? If so, a note should be added to 
> the draft that says that using index() on nested repeats may lead to 
> strange (and unexpected) results.
> 
> If this interpration is wrong, because index('repeatBookmarks') should 
> return 1 in step 3 because the value of index('repeatSections') changed, 
> it should also be specified.
> 
> Regards,
> Jérôme
Received on Tuesday, 27 August 2002 09:38:15 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 10 June 2009 18:12:11 GMT