Hierarchy of active grammars

When the VoiceXML browser receives a recognized word or phrase from the speech recognition engine, the browser searches the active grammars, in the following order, looking for a match:

  1. Grammars for the current field, including grammars contained in links in that field.
  2. Grammars for the current form, including grammars contained in links in that form.
  3. Grammars contained in links in the current document, and grammars for menus and other forms in the current document that have document scope.
  4. Grammars contained in links in the application root document, and grammars for menus and other forms in the application root document that have document scope.
  5. Grammars for the VoiceXML browser itself (that is, universal commands).

Disabling active grammars

You can temporarily disable active grammars, including the VoiceXML browser's grammars for built-in commands, by using the modal attribute on various form items. When modal is set to true, all grammars are temporarily disabled except the grammar for the current form item.

Resolving ambiguities

Ambiguities can arise when a user's utterance matches more than one of the following:

You should exercise care to avoid using the same word or phrase in multiple grammars that could be active concurrently; the VoiceXML browser resolves any ambiguities by using the first matching value.

Understanding how disambiguation works is especially important when multiple phrases in concurrently active grammars contain the same key words.