VoiceXML 2.1 Development Guide Home  |  Frameset Home


<else>  element


The else element is used as the final logic constructor in an array of conditional statements. The content nested within the else element will get executed when all other if and elseif  cond attributes evaluate to ‘false’.


usage

<else />


attributes

none


shadow variables

none


parents

<if>


children

none


code samples

<If-Else-ElseIf> sample
<?xml version="1.0" encoding="UTF-8"?>

<vxml version = "2.1">

<meta name="author" content="Matthew Henry"/>
<meta name="copyright" content="2005 voxeo corporation"/>
<meta name="maintainer" content="YOUR_EMAIL@HERE.COM"/>


<form id="F1">
  <field name="F_1">
    <prompt> who would win in a fist fight, Oprah, Madonna, or James Brown? </prompt>
    <grammar type="text/gsl">[ oprah madonna (james brown) ] </grammar>

    <filled>
      <if cond="F_1=='oprah'">
        <prompt>
          you really think Oprah could duke it out
          with the Godfather of soul?
        </prompt>

      <elseif cond="F_1=='madonna'"/>
        <prompt>
          madonna would get creamed, who do
          you think you are kidding?
        </prompt>

      <else/>
        <prompt>
          James Brown would whip up on both
          Oprah and Madonna
        </prompt>

      </if>
    </filled>
</field>

</form>
</vxml>



additional links

W3C 2.0 Specification


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

login



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