VoxML 1.0 Element Reference
ERROR Element
Examples
1<STEP NAME="errors">
2<ERROR TYPE="nomatch"> First error message.
3I did not understand what you said. </ERROR>
4<ERROR TYPE="nomatch" ORDINAL="2">
5Second error message.
6I did not understand what you said. </ERROR>
7<PROMPT> This step tests error messages.
8Say 'oops' twice. Then say 'done' to
9choose another test. </PROMPT>
10<INPUT TYPE="OPTIONLIST">
11<OPTION NEXT="#end"> done </OPTION>
12</INPUT>
13</STEP>
The code shown above illustrates the use of the ERROR element to define the application's behavior in response to an error. On line 2, we define the error message to be used the first time an error of type “nomatch” occurs in this STEP. On line 4, we define the error message to be used the second and all subsequent times an error of type "nomatch" occurs in this STEP.
The ORDINAL attribute determines which message will be used in the case of repeated errors within the same STEP. The VoxML voice browser will choose an error message based on this simple algorithm: If the error has occurred 3 times, the browser will look for an ERROR element with ORDINAL of “3”. If no such ERROR element has been defined, the voice browser will look for an ERROR with ORDINAL of “2”, and then “1”, and then an ERROR with no ORDINAL defined.
So, if we had defined an ERROR element with ORDINAL of “6” in the STEP shown above, and the same error occurred 6 times in a row, the user would hear the first error message one time, then the second error message 4 times, and finally the error message with ORDINAL of “6”.
October 1998 | VoxML 1.0 Language Reference 17 |