Re: [long] nested repeats and index()

Hi,

I think this applies also to delete; When an item in the outer repeat is 
deleted, the outer cursor changes to the next item or zero, and the 
inner cursor must be updated.

Would the following text do in 9.3.6. -3 :

    3. If the last remaining item in the collection is removed, the 
cursor position becomes 0 and the cursors for inner nested collections 
become 0 as well. Otherwise, the cursor will point to the new n-th item. 
nad the cursors for inner nested collections are re-initialized to point 
at the head of the collection.

If this feels too complicated, it could be possible to cook up a rule 
that would automatically apply to all situations in insert, delete and 
setindex. Cannot do it not off the top of my head :).

thanks,

-mikko

Micah Dubinko wrote:
> Mikko,
> 
> I've made the change you quoted below for insert and setindex.
> 
> You also said:
> 
> 
>>By the way, this applies also to 9.3.6 -3. (delete)
> 
> 
> Are you sure? For delete, wouldn't there be nothing left to set a new index
> on?
> 
> Can you provide specific text (if necessary) for 9.3.6?
> 
> Thanks,
> 
> .micah
> 
> -----Original Message-----
> From: Mikko Honkala [mailto:honkkis@tml.hut.fi]
> Sent: Tuesday, August 27, 2002 6:41 AM
> To: Jérôme Nègre
> Cc: www-forms-editor@w3.org
> Subject: Re: [long] nested repeats and index()
> 
> 
> 
> 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 Wednesday, 18 September 2002 04:59:08 UTC