block

block element

Specifies a block of directives that are executed in document source order.

Syntax

<block 
cond = "ECMAScript_Expression"
expr = "ECMAScript_Expression"
name = "string"
/>

Attributes

cond

A condition that must evaluate to true for the element to be selected by the form interpretation algorithm (FIA). If this condition evaluates to false or the variable associated with the name attribute has a defined value, the element is not visited.

expr

An ECMAScript expression that supplies the initial value for the form item variable associated with this element. If the expression evaluates to something other than null or ECMAScript undefined, the element will not be visited until the form item variable is explicitly cleared.

name

The name of the form item variable associated with this block element.

Parents

form

Children

assign, audio, break, clear, data, disconnect, enumerate, exit, foreach, goto, if, log element, mark, prompt, reprompt, return, script, submit, throw, value, var

Remarks

The Tellme VoiceXML interpreter creates an implicit form item variable for a block that you do not name explicitly. Although the variable name is currently predictable, your application code should not rely upon it since it is likely to change in a future release. To manipulate the form item variable associated with a block you must explicitly set the name attribute. If you attempt to reference an implicitly declared form item variable, the following deprecation warning will appear in the Debug Log: "possible direct access of internal variable".

Examples

The following example shows the declaration and the use of a single variable within the anonymous context of the block element. When the form is done executing, the VoiceXML interpreter navigates to the main Tellme menu.

<?xml version="1.0"?>
<vxml version="2.1"
 xmlns="http://www.w3.org/2001/vxml">
   <form>
       <block>
          <var name="company" expr="'Tellme'"/>
          The company is <value expr="company" />
       </block>
   </form>
</vxml>