Re: <foreach>: concern about executable content

Andrew Hunt and David Scarratt:

Thank you for your detailed comments [1][2] regarding the <foreach> element
and its relationship to the ECMAScript data model in the VoiceXML 2.1
Candidate Recommendation.  The semantics of this element have been the
subject of much discussion within the working group.  We have tried to
clarify the text in several areas while maintaining much of the enhanced
expressive power.

Your recent email [1] questions whether the content model for the <foreach>
element is appropriate.  The Voice Browser Working Group has received
several comments on this topic.  We have considered the issues raised and
examined a number of use cases.  The result of this process is that the
content model of the <foreach> element will be altered in line with your
suggestion:

    When the <foreach> appears within a <prompt> element, it will
    have the same content model as the <enumerate> element.  This
    allows application authors to perform prompt concatenation of
    Array content.  When the <foreach> element appears in
    executable content (other than within a <prompt>), any 
    executable content may appear.  This introduces a looping 
    construct in executable content which is otherwise difficult 
    to author.

These two content models will be enforced in the VoiceXML 2.1 schema.


In a second email [2], you requested clarification for four additional
areas.

1. Misleading section title

The section title will be changed in the next published version to clarify
that the <foreach> element has two different uses.

2. Type of "array"

The text describing the <foreach> element will be changed to explicitly
require that the 'array' attribute must evaluate to an ECMAScript Array
object (described in section 15.4 of the ECMA-262 specification).  One or
more new implementation report tests will be created to cover this behavior.


3. Unspecified "store" behavior

The text describing the <foreach> element will explicitly note that a copy
of the 'array' is created and that 'item' is assigned a shallow copy of each
array element.  One or more new implementation report tests will be created
to cover this behavior.

4. Under-specified iteration behavior
 
The text describing the <foreach> element will explicitly describe the
iteration as starting from element zero and proceeding by one to
'array.length - 1'.  One or more new implementation report tests will cover
this iteration process for sparse arrays.


We hope to publish a new draft shortly and we welcome your review of the
updated text.

[1] http://lists.w3.org/Archives/Public/www-voice/2006JulSep/0040.html
[2] http://lists.w3.org/Archives/Public/www-voice/2006JulSep/0039.html

Received on Tuesday, 12 September 2006 01:23:28 UTC