Home > Articles > Web Services > XML

  • Print
  • + Share This
This chapter is from the book

This chapter is from the book

3.12 enumerate

Element type

enumerate

Attributes

None.

Parents

audio | catch | choice | emphasis | error | field | filled | help | if | initial | menu | noinput | nomatch | object | paragraph | prompt | prosody | record | sentence | subdialog | transfer | voice

Children

PCDATA | audio | break | emphasis | enumerate | log | mark | paragraph | phoneme | prosody | say-as | sentence | value | voice

Description

Iterates over the choices in the parent menu or the options in the parent field and renders each of them, based optionally on a speech template defined by the element's children. This speech template indicates how each iteration should be rendered. It can use the following variables:

_prompt

The prompt for the current choice.

_dtmf

The assigned DTMF for the current choice.

DTD

<!ELEMENT enumerate (%audio; | %tts;)* >

Language model


03mod12.gif


Attributes

None.

Children

audible and tts elements

Used to define the enumeration template. The template define show each choice or option will be rendered to audio.

Examples

Example 3-14 Enumerating a menu

<?xml version="1.0" encoding="iso-8859-1"?>
<vxml version="1.0">
  <form> 
    <field name="maincourse"> 
      <prompt> 
        Please select an entree. Today, we're featuring 
        <enumerate>
          <value expr="_prompt"/> 
          which can be ordered by pressing 
          <value expr="_dtmf"/>
        </enumerate>
      </prompt> 
      <option dtmf="1" value="fish"> swordfish </option> 
      <option dtmf="2" value="beef"> roast beef </option> 
      <option dtmf="3" value="chicken"> frog legs </option> 
      <filled> 
        <submit next="/cgi-bin/maincourse.cgi" method="post" 
                                       namelist="maincourse"/>
      </filled> 
    </field> 
  </form> 
</vxml>
  • + Share This
  • 🔖 Save To Your Account