Last reviewed: 3/23/2024 12:08:32 PM
In this article
<else>
An <else> element used in <if> elements.
Syntax
<else />
Attributes
none
Children
none
Parents
Variables
none
Example
The following example illustrates using example elements.
<if cond="total > 1000">
<prompt>This is way too much to spend.</prompt>
<throw event="com.xyzcorp.acct.toomuchspent"/>
</if>
<if cond="amount < 29.95">
<assign name="x" expr="amount"/>
<else/>
<assign name="x" expr="29.95"/>
</if>
<if cond="flavor == 'vanilla'">
<assign name="flavor_code" expr="'v'"/>
<elseif cond="flavor == 'chocolate'"/>
<assign name="flavor_code" expr="'h'"/>
<elseif cond="flavor == 'strawberry'"/>
<assign name="flavor_code" expr="'b'"/>
<else/>
<assign name="flavor_code" expr="'?'"/>
</if>
Version Information
Supported in: VoiceXML 1.0, VoiceXML 2.0, and VoiceXML 2.1.