example element
VoiceXML 2.0
Defines an example phrase.

Syntax

<example />

Parents
rule

Children
None.

Examples

The following example defines a simple yes-no-cancel grammar and provides an example to demonstrate its usage.

<grammar xml:lang="en-US" 
         type="application/srgs+xml" 
         version="1.0" 
         tag-format="semantics/1.0"
         root="yes_no_cancel"
         mode="voice">
   <rule id="yes_no_cancel" scope="public"> 
      <one-of>
         <item>
            no
            <tag>out = "no";</tag>
         </item>
         <item> 
           <one-of>
             <item>yes</item>
             <item>okay</item>
           </one-of>
           <tag>out = "yes";</tag>
         </item>
         <item>
           cancel
           <tag>out = "cancel";</tag>
         </item>
      </one-of>
      <example>okay</example>
   </rule>
</grammar>


[24]7 Inc.| Terms of Service| Privacy Policy| General Disclaimers