developer_guide:voicexml_references:elements:var

< var >

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"/>
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.
<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>
  • developer_guide/voicexml_references/elements/var.txt
  • Last modified: 2015/10/27 21:47
  • by borja