Motorola 1 manual Examples

Page 17

VoxML 1.0 Element Reference

CLASS Element

Examples

1<CLASS NAME="simple">

2<HELP> Your choices are <OPTIONS/> </HELP>

3<ERROR> I did not understand what you said.

4Valid responses are <OPTIONS/> </ERROR>

5</CLASS>

6

7<STEP NAME="beverage" PARENT="simple">

8<PROMPT> Please choose a drink. </PROMPT>

9<INPUT NAME="drink" TYPE="optionlist">

10<OPTION NEXT="#food"> coke </OPTION>

11<OPTION NEXT="#food"> pepsi </OPTION>

12</INPUT>

13</STEP>

14

15 <STEP NAME="food" PARENT="simple">

16<PROMPT> Please choose a meal. </PROMPT>

17<INPUT NAME="meal" TYPE="optionlist">

18<OPTION NEXT="#deliver"> pizza </OPTION>

19<OPTION NEXT="#deliver"> tacos </OPTION>

20</INPUT>

21</STEP>

The code shown on lines 1-5 illustrates the use of the CLASS element to define a HELP element and an ERROR element that will be used in several STEPs within this DIALOG.

The code on lines 7 and 15 illustrates the use of the PARENT attribute on the STEP element to refer to the CLASS element, and therefore inherit the behaviors defined within it.

When interpreted by the VoxML voice browser, the STEPs defined on lines 7- 13 and lines 15-21 will behave as if the HELP and ERROR elements that are defined in the CLASS were defined explicitly in the STEPs themselves.

October 1998

VoxML 1.0 Language Reference 13

Image 17
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