Table of Contents

< var >

Description

The <var> element declares a variable in the scope of its parent element. If the variable is already defined in the current scope, further declaration is treated as value assignments.

Syntax

<var
name="String"
expr="ECMAScript_Expression"/>

Attributes

nameThe name attribute defines the name of the variable. This attribute is required.
exprThe expr attribute is the initial value of the variable. This attribute is optional and defaults to undefined.

Parents

<block>, <catch>, <error>, <filled>, <form>, <help>, <if>, <noinput>, <nomatch>, <vxml>

Children

None.

Extensions

None.

Limitations/Restrictions

None.

Example Code

<?xml version="1.0"?>
<vxml version="2.0" xmlns="http://www.w3.org/2001/vxml">
 <var name="world" expr="'world'"/>
 <form>
  <field name="hello">
   <grammar>hello | goodbye</grammar>
   <help>Just say hello</prompt>
   <prompt>Say hello</prompt>
   <noinput>Say something</noinput>
   <filled>
    <prompt>Hello, 
     <value expr="world"/>!
    </prompt>
   </filled>
  </field>
 </form>
</vxml>