Description
Defines a menu item. The <choice> element serves
several purposes:
<enumerate> prompt string.Syntax
<choice
dtmf="DTMF_sequence"
accept="exact" | "approximate"
next="URI"
expr="ECMAScript_Expression"
event="event"
eventexpr="ECMAScript_Expression"
fetchaudio="URI"
fetchaudiodelay="time_interval"
fetchaudiominimum="time_interval"
fetchhint="safe"
fetchtimeout="time_interval"
maxage="integer"
maxstale="integer"
message="string"
messageexpr="ECMAScript_Expression">
child elements
</choice> |
Attributes
|
Attribute |
Description |
|
dtmf |
A DTMF sequence to select this choice. Optional. |
|
accept |
Overrides the setting for the
|
|
next |
The URI of the dialog (i.e. form or menu) or document to transition to when this choice is selected. Exactly one of next, expr, event, or eventexpr must be specified. |
|
expr |
An ECMAScript expression to be evaluated and used as the URI of the dialog (i.e. form or menu) or document to transition to when this choice is selected. Exactly one of next, expr, event, or eventexpr must be specified; next has precedence over this attribute. |
|
event |
The name of the event to be thrown when this choice is selected. Exactly one of next, expr, event, or eventexpr must be specified; next and expr have precedence over this attribute. |
|
eventexpr |
An ECMAScript expression to be evaluated and used as the name of the event to be thrown when this choice is selected. Exactly one of next, expr, event, or eventexpr must be specified; next and expr have precedence over this attribute. |
|
fetchaudio |
The URI of audio to play while waiting for the document to be fetched. Optional. |
|
fetchaudiodelay |
The length of time to wait at the start of the fetch delay
before playing |
|
fetchaudiominimum |
The minimum length of time to play |
|
fetchhint |
Defines when the next document should be fetched. Optional.
|
|
fetchtimeout |
The length of time to wait for the next document to be fetched
before throwing an |
|
maxage |
Indicates that this document is willing to use a cached copy of the next document only while the age of the cached copy is less than or equal to the number of seconds specified by this attribute. Optional. |
|
maxstale |
Indicates that this document is willing to use a cached copy of the next document that has exceeded its expiration time by as much as the number of seconds specified by this attribute. Optional. |
|
message |
A message string providing additional context about the event
being thrown. The message will be available as a variable within
the scope of the |
|
messageexpr |
An ECMAScript expression to be evaluated and used as a message
string, as documented under |
Attribute Notes
error.badfetch event is thrown if
next or expr
refer to a non-existent dialog (i.e. form or menu), either
within the same page, or within a different, existent, page.
Parents
Children
<audio>, <dtmf>, <grammar>, <value>, Speech Markup (SSML), #PCDATA
extensions
fetchaudiodelay attribute.fetchaudiominimum attribute.<dtmf> as a child, to be used like
<grammar>.
<audio>, <value>, and
Speech Markup (SSML) tags as children, to be used in the
<enumerate> prompt string (but not in the speech
grammar fragment).
Limitations/Restrictions
<mark> is not supported within
SSML content in <choice>. Example
<?xml version="1.0"?>
<vxml version="2.0" xmlns="http://www.w3.org/2001/vxml">
<menu>
<prompt> What do you want to drink, coffee or tea? </prompt>
<choice next="#getcoffee"> coffee </choice>
<choice next="#gettea"> tea </choice>
</menu>
<form id="getcoffee">
<block>
Ok, here's your coffee.
</block>
</form>
<form id="gettea">
<block>
Ok, here's your tea.
</block>
</form>
</vxml> |