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 |