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.
<var name="String" expr="ECMAScript_Expression"/>
| name | The name attribute defines the name of the variable. This attribute is required. |
| expr | The expr attribute is the initial value of the variable. This attribute is optional and defaults to undefined. |
<block>, <catch>, <error>, <filled>, <form>, <help>, <if>, <noinput>, <nomatch>, <vxml>
None.
None.
None.
<?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>