CCXML Voxeo 1.0 Development GuideHome  |  Frameset Home

This documentation is for CCXML 1.0-Voxeo, which has been superceded by CCXML 1.0-W3C. The CCXML-Voxeo platform is not being updated any longer. The CCXML 1.0-W3C version, however, has many new features and is actively being enhanced. If you're writing a new CCXML application, you should use CCXML 1.0-W3C. Click here for the CCXML 1.0-W3C documentation.
<elseif>  element

The elseif element is used to specify additional content when all other else or if  statements equate to ‘false’.  When a series of if-elseif-else statements are encountered, the application will execute the first one which evaluates to ‘true’.


usage
<elseif cond="(ECMAScript Expression)">


attributes
condData Type: (ECMAScript Expression)Default: none - attribute is required
The cond attribute specifies an ECMAScript expression which can be evaluated to 'true' or 'false'. A condition must evaluate to 'true' in order for any enclosed operations to be performed.



parents
none


children
none


code samples
<Elseif cond> sample
<?xml version="1.0" encoding="UTF-8" ?>
<ccxml version="1.0">

<var name="state0" expr="'init'"/>

  <eventhandler statevariable="state0">

    <transition event="connection.CONNECTION_ALERTING" name="evt">
      <log expr="'*** INCOMING CALLID IS: ' + evt.calledid + ' ***'"/>
      <accept/>
    </transition>

    <transition event="connection.CONNECTION_CONNECTED">
      <log expr="'*** INCOMING CALL WAS ANSWERED ***.'"/>

      <if cond="evt.callerid == '4075551234'">
        <log expr="'*** \'IF\' CONDITION IS TRUE ***'"/>
      <elseif cond="evt.callerid == '4075554321'"/>
        <log expr="'*** \'ELSEIF\' CONDITION IS TRUE ***'"/>

      <else/>
        <log expr="'*** \'ELSE\' STATEMENT REACHED ***'"/>
        <disconnect/>
      </if>

    </transition>


<!-- ****************** GENERAL EXCEPTIONS ******************** -->
    <transition event="call.CALL_INVALID">
      <exit/>
    </transition>

    <transition event="error.*" name="evt">
      <log expr="'*** ERROR HAS OCCURED [' + evt.error + '] ***'"/>
      <exit/>
    </transition>
  </eventhandler>

</ccxml>



additional links
W3C Specification


  ANNOTATIONS: EXISTING POSTS
moshe
6/10/2004 10:07 AM (EDT)
The usage statement has a typo: It should read:

<elseif cond="(ECMAScript Expression)"/>

Note that it ends with a "/>", not just a ">".


login



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