CCXML 1.0-W3C Development GuideHome  |  Frameset Home


<var>  element

The <var> element is used to explicitly declare CCXML variables. All expressions must be valid ECMAScript expressions, assignable to variables with valid ECMAScript names.



usage
<var expr="(ECMAScript Expression)" name="(variable name)">


attributes
exprData Type: (ECMAScript Expression)Default: none - attribute is required
The expr attribute specifies the value to assign to the variable in question. This may be any valid ECMAScript value.
nameData Type: (variable name)Default: none - attribute is required
The name attribute indicates the name of the variable. Any valid ECMAScript variable names are permitted as a value for this attribute.



parents
none


children
none


code samples
<1.0 var -name-expr> sample
<?xml version="1.0" encoding="UTF-8"?>
<ccxml version="1.0" xmlns="http://www.w3.org/2002/09/ccxml">

  <var name="BenFranklin"
      expr="'They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.'"/>


<eventprocessor>
  <transition event="connection.alerting">
  <accept/>
  <log expr="'***** CALL ACCEPTED *****'"/>
  </transition>

  <transition event="connection.connected">
  <log expr="'*** BEN FRANKLIN SAYS: ' + BenFranklin"/>
  <dialogstart src="'null://?text=' + BenFranklin" type="'application/x-texttospeech'"/> 
  </transition>

  <transition event="dialog.exit">
    <log expr="'***** CALL EXITING *****'"/>
    <exit/>
  </transition>

  <transition event="error.*">
  <log expr="'ERROR OCCURRED: '+ event$.name"/>
  <exit/>
  </transition>
</eventprocessor>

</ccxml>



additional links
W3C Specification


  ANNOTATIONS: EXISTING POSTS
0 posts - click the button below to add a note to this page

login



© 2008 Voxeo Corporation  |  Voxeo IVR  |  VoiceXML & CCXML IVR Developer Site