<block>
Defines a container of non-interactive executable code.
Code within a <block> element does not require user input, and will be executed immediately so long as the <block> guard variable is undefined and its cond condition evaluates to true.
Attributes
This section describes the attributes you can set for this element.
Name |
Data type |
Default |
---|---|---|
CDATA |
optional |
|
CDATA |
optional |
|
NMTOKEN |
optional |
cond
The cond attribute specifies an ECMA expression that must evaluate to the Boolean TRUE before the form item is available for selection within the Form Interpretation Algorithm (FIA).
expr
The expr attribute specifies the initial value of the form-item variable. The default value of the expr attribute is undefined. If you set the expr attribute to a value other than the default, you will need to clear this value before the content of the form-item element can be executed.
name
The name attribute specifies the name of the form item's guard variable. The Form Interpretation Algorithm (FIA) initializes this variable with the value specified by the expr attribute. If the form-item comes up for selection at a later time, it will be populated by the pre-defined type for that element. Since the resulting value is a random constant chosen by the interpreter, it is of no importance. What is important to remember, however, is that the value exists and it's not undefined.
Children (optional)
- Parsed character data
- <nuance:address>
- <assign>
- <audio>
- <clear>
- <data>
- <disconnect>
- <enumerate>
- <exit>
- <foreach>
- <goto>
- <if>
- <log>
- <prompt>
- <reprompt>
- <return>
- <script>
- <nuance:send>
- <submit>
- <nuance:taskbegin>
- <nuance:taskend>
- <throw>
- <value>
- <var>
Parents
Sample code
<vxml>
<var name="x" expr="0"/>
<form>
<block>
<assign name="x" expr="x+1"/>
<log expr="'Infinite loop, execution number: ' + x"/>
<clear/>
</block>
</form>
</vxml>