Motorola 1 manual Examples

Page 47

VoxML 1.0 Element Reference

RESPONSE Element

Examples

1 <INPUT TYPE="GRAMMAR"

2SRC="gram://.Banking/action/amt/fromacct/toacct"

3NEXT="#notenoughfields">

4<RESPONSE FIELDS="action,amt,fromacct,toacct"

5NEXT="#doit"/>

6<RESPONSE FIELDS="action,amt,fromacct"

7NEXT="#asktoacct"/>

8<RESPONSE FIELDS="action,amt,toacct"

9NEXT="#askfromacct"/>

10<RESPONSE FIELDS="action,amt" NEXT="#askaccts"/>

11<RESPONSE FIELDS="action" NEXT="#askamtaccts"/>

12</INPUT>

This example illustrates how the RESPONSE element can be used to deal with situations where the user specifies less than all the possible variables available in the grammar. Using the RESPONSE element, the application can arrange to collect only the information not already filled in by prior steps.

In particular this example transfers to the “askaccts” STEP if neither the source nor destination account is specified (for example, the user said “transfer 500 dollars”), but it transfers to the “askfromacct” STEP if the user said what account to transfer to, but did not specify a source account (for example, if the user had said “transfer 100 dollars to savings”).

The NEXT URL on the INPUT element is used when the user’s response does not match any of the defined RESPONSEs.

October 1998

VoxML 1.0 Language Reference 43

Image 47
Contents Revision VoxML Language ReferencePage Contents Appendices Purpose of this Document What is VoxMLOverview DIALOGs and STEPs Structure of a VoxML DocumentBasic Elements VoxML 1.0 Application Development Guide Other Reference DocumentationAttributes ACK ElementSyntax Examples Audio Element Break Element Next step URL Cancel ElementExamples Case Element Integer Class ElementExamples Dialog Element EMP Element Error Element Input TYPE=OPTIONLIST Help Element Option NEXT=#end done /OPTION 11 /INPUT 12 /STEP Input Element Data Format Input Element Type DateInput Element Type Digits Input Element Type Grammar Input Element Type Hidden Input Element Type Money Input Element Type None Input Element Type Number Input Element Type Optionlist Input Element Type Phone Input Element Type PROFILE‡ Input Element Type Record Prompt Input Element Type Time Input Element Type Yorn Option Element VoxML 1.0 Element Reference Options Element Syntax Attributes Or ElementPrompt Element Pros Element Rename Element Response Element Examples Step Element Switch Element Prompt Value ElementAppendix a VoxML 1.0 Document Type Definition AppendicesOctober VoxML 1.0 Language Reference Vcard Profile Names and Subtypes Appendix B Vcard Profile Names and SubtypesFirst