Plum DEV Documentation
voicexml:tags:rule

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

voicexml:tags:rule [2014/05/30 12:49]
jennifer added meta description
voicexml:tags:rule [2019/09/17 12:29]
Line 1: Line 1:
-{{description>​‹rule› VoiceXML tag details, attributes and VXML code example | A rule block contains a SRGS+XML grammar rule definition.}} 
-=====<​rule>​===== 
- 
-An SRGS+XML rule definition is contained within a <​rule>​ block. 
-====Attributes==== 
-| id | This attribute specifies the rulename for the rule. | 
-| scope | Can be either "​public"​ or "​private"​. | 
- 
-====Notes==== 
- 
-For examples and usage information,​ please refer to the [[http://​www.w3.org/​TR/​2002/​CR-speech-grammar-20020626/​|Speech Recognition Grammar Specification]]. 
- 
-====Example==== 
-<​code>​ 
-<?xml version="​1.0"?>​ 
-<vxml version="​2.0">​ 
-  <​form>​ 
-    <field name="​animal">​ 
-      <grammar type="​application/​srgs+xml"​ root="​ROOT"​ mode="​voice">​ 
-        <rule id="​ROOT">​ 
-          <​one-of>​ 
-            <​item>​Dog</​item>​ 
-            <​item>​Cat</​item>​ 
-          </​one-of>​ 
-        </​rule>​ 
-      </​grammar>​ 
-      <​prompt>​ 
-        Say either dog or cat. 
-      </​prompt>​ 
-      <​filled>​ 
-        <​prompt>​ 
-          You said <value expr="​animal"/>​. Goodbye. 
-        </​prompt>​ 
-        <​exit/>​ 
-      </​filled>​ 
-    </​field>​ 
-  </​form>​ 
-</​vxml>​ 
-</​code>​ 
-The output of the above script would be: 
- 
-Computer: Say either dog or cat. \\ 
-Human: Dog. \\ 
-Computer: You said dog. \\ 
- 
- 
-====Child Tags==== 
- 
-[[voicexml:​tags:​example|<​example>​]],​ [[voicexml:​tags:​item|<​item>​]],​ [[voicexml:​tags:​one-of|<​one-of>​]],​ [[voicexml:​tags:​ruleref|<​ruleref>​]],​ [[voicexml:​tags:​tag|<​tag>​]],​ [[voicexml:​tags:​token|<​token>​]] 
- 
-====Parent Tags==== 
- 
-[[voicexml:​tags:​grammar|<​grammar>​]] 
-