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

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