# VoiceXML coding tips

The following tips provide basic information on VoiceXML and the VoiceXML editor.

#### VoiceXML application structure

VoiceXML applications can consist of one or more VoiceXML documents, plus any associated grammar, pronunciation, prerecorded audio, and/or ECMAScript files. In the Voice tools, generally, you should have one project for each voice application.

VoiceXML documents consist of two basic types of dialogs: forms and menus.

Table 1. VoiceXML dialogs
Type | Description
--- | ---
Form | A dialog that uses fields to supply information and accept data inputs.
Menu | A dialog that offers the user one or more choices, and the selection routes the dialog flow to a different point in the application.

#### Features of the VoiceXML Editor

- The DOCTYPE declaration is automatically added below the XML processing instruction (<?xml...) when you create new VoiceXML files, which enables proper validation and Content Assist. If you open an existing VoiceXML file that does not already have the DOCTYPE, you can update the file with the correct definition by saving the file.
- To use content assist, hold down the Ctrl key and press the Space bar. The pop-up window shows a list of valid tags or attributes at the cursor location.
- You can specify attributes and their corresponding values in either the VoiceXML source editor or the Properties view.
- The Outline view shows the hierarchy of tags in your VoiceXML file. When you select a tag, the corresponding lines are highlighted in the VoiceXML editor.
- You can launch other editors from within the VoiceXML editor. In order to do this:
  1. Place thecurson on the tag that has a reference to another file
  2. Right mouse to bting up the Context Menu
  4. Select Edit Referenced File
- Format options are available to automatically format your source code.

Related Information

- What is VoiceXML?
- What is ECMAScript?
- Content assist in the VoiceXML editor
- Creating a VoiceXML file
- Adding VoiceXML elements and attributes
- VoiceXML 2.1 Specification