Motorola 1 manual Structure of a VoxML Document, DIALOGs and STEPs

Page 6

An Introduction to VoxML 1.0

Structure of a VoxML Document

Structure of a VoxML Document

VoxML documents have a hierarchical structure, in which every element (except the DIALOG element) is contained by another element. In contrast to HTML, there is a strict containment relationship enforced by the language, so there can be no ambiguity as to which element contains which.

DIALOGs and STEPs

The two most fundamental elements in VoxML are the DIALOG element and the STEP element. These elements provide the basic structure of a VoxML application.

The DIALOG element defines the scope of a VoxML document. All other VoxML elements are contained by the DIALOG element. In normal cases, one can equate a DIALOG to a file, in much the same way that there is one HTML element per file when developing HTML-based applications.

The STEP element defines a state within a DIALOG, or to say it another way, the STEP element defines an application state.

Together the DIALOG element and the associated STEP elements define a state machine that represents an interactive dialogue between the application and a user. When the VoxML voice browser interprets the VoxML document, it will navigate through the DIALOG to different STEPs as a result of the user’s responses.

Here is a simple VoxML example, which has 1 DIALOG and 2 STEPs.

1<?xml version="1.0"?>

2<DIALOG>

3<STEP NAME="init">

4<PROMPT> Please select a soft drink. </PROMPT>

5<HELP> Your choices are coke, pepsi, 7 up,

6or root beer. </HELP>

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

8<OPTION NEXT="#confirm"> coke </OPTION>

9<OPTION NEXT="#confirm"> pepsi </OPTION>

10<OPTION NEXT="#confirm"> 7 up </OPTION>

11<OPTION NEXT="#confirm"> root beer </OPTION>

12</INPUT>

13</STEP>

14<STEP NAME="confirm">

15<PROMPT> You ordered a <VALUE NAME="drink"/>.

16</PROMPT>

17</STEP>

18</DIALOG>

When this VoxML document is interpreted, the voice browser will begin by executing the STEP called “init”. The user will hear the text contained by the PROMPT element. If the user were to ask for “help” before making a selection, the user would hear the text contained with the HELP element. After the user makes a selection, the voice browser will execute the STEP named “confirm”, which will simply read back the user’s selection and then exit the application.

October 1998

VoxML 1.0 Language Reference 2

Image 6
Contents VoxML Language Reference RevisionPage Contents Appendices What is VoxML OverviewPurpose of this Document Structure of a VoxML Document DIALOGs and STEPsBasic Elements Other Reference Documentation VoxML 1.0 Application Development GuideACK Element SyntaxAttributes Examples Audio Element Break Element Cancel Element Next step URLExamples Case Element Class Element IntegerExamples Dialog Element EMP Element Error Element Input TYPE=OPTIONLIST Help Element Option NEXT=#end done /OPTION 11 /INPUT 12 /STEP Input Element Input Element Type Date Data FormatInput 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 Or Element Syntax AttributesPrompt Element Pros Element Rename Element Response Element Examples Step Element Switch Element Value Element PromptAppendices Appendix a VoxML 1.0 Document Type DefinitionOctober VoxML 1.0 Language Reference Appendix B Vcard Profile Names and Subtypes Vcard Profile Names and SubtypesFirst