Last reviewed: 3/23/2024 12:00:25 PM

<block>

A <block> element is a container of non-interactive executable code.

Syntax

<block cond="expression"
       expr="expression"
       name="var" />

Attributes

cond

An expression that must evaluate to true after conversion to boolean in order for the form item to be visited.

expr

The initial value of the form item variable; default is ECMAScript undefined. If initialized to a value, then the form item will not be visited unless the form item variable is cleared.

name

The name of the form item variable used to track whether this block is eligible to be executed. The default value is an inaccessible internal variable.

Children

<assign>, <audio>, <clear>, <disconnect>, <enumerate>, <exit>, <goto>, <if>, <log>, <prompt>, <reprompt>, <return>, <script>, <submit>, <throw>, <value>, and <var>.

Parents

<form>.

Variables

none

Example

The following example illustrates using a <block> element.

<?xml version="1.0" encoding="UTF-8"?>
<vxml xmlns="http://www.w3.org/2001/vxml" 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
  xsi:schemaLocation="http://www.w3.org/2001/vxml 
   http://www.w3.org/TR/voicexml20/vxml.xsd"
   version="2.0">
 <meta name="author" content="VoiceXML 2.0"/>
 <meta name="maintainer" content="productsupport@chant.net"/>
 <form>
    <block>Hello World!</block>
 </form>
</vxml>

Version Information

Supported in: VoiceXML 1.0, VoiceXML 2.0, and VoiceXML 2.1.