3.9. else

Element typeelse
AttributesNone.
Parentsif
ChildrenNone.
DescriptionDeclares the beginning of the "else code" within an if element. All elements within the if element after the else element are executed only if the if element's cond attribute and its contained elseif elements' cond attributes all evaluate to false.

DTD

<!ELEMENT else EMPTY >

Language model



Attributes

None.

Children

None.

Examples

Example 3-11. Using the if-else logic
<?xml version="1.0" encoding="iso-8859-1"?>
<vxml version="1.0">
  <form id="pick">
    <field name="select">
      <grammar>one|two|three</grammar>
      <prompt>Pick a number from one to three.</prompt>
      <filled>
        <if cond="select=='one'">
          <prompt>Your selection was one.</prompt>
          <elseif cond="select=='two'"/>
          <prompt>Your selection was two.</prompt>
          <else/>
          <prompt>Your selection was three.</prompt>
        </if>
      </filled>
    </field>
  </form>
</vxml>

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.19.162