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

RE: [long] nested repeats and index()

From: Micah Dubinko <MDubinko@cardiff.com>
Date: Tue, 17 Sep 2002 15:50:12 -0700
Message-ID: <E840F0B7E6189547BDB91DA8BF2228AB28C745@csmail.cardiff.com>
To: "'Mikko Honkala'" <honkkis@tml.hut.fi>, Jérôme Nègre <jerome.negre@e-xmlmedia.fr>
Cc: "'www-forms@w3.org'" <www-forms@w3.org>

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 Tuesday, 17 September 2002 18:50:20 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 10 March 2012 06:21:52 GMT