one-of element
VoiceXML 2.0
Defines a set of alternative expressions.

Syntax

<one-of />

Attributes

None.


Parents
item, rule

Children
item

Examples

The grammar in the following example represents a list of subjects. If the recognizer matches "overview" or "general", it returns the value "1". If the recognizer matches "design", it returns "2". If the recognizer matches "production" or "audio", it returns "3". If the recognizer matches "development" or "VoiceXML", it returns "4". If the recognizer matches "tuning", it returns "5."

<?xml version= "1.0"?>

<grammar mode="voice"
         root="root_rule"
         tag-format="semantics/1.0"
         version="1.0"
         xml:lang="en-US"
         xmlns="http://www.w3.org/2001/06/grammar">
  <rule id="root_rule" scope="public">
    <one-of>
      <item>
        <one-of>
          <item>
            overview
          </item>
          <item>
            general
          </item>
        </one-of>
        <tag>out.subject = "1";</tag>
      </item>
      <item>
        design
        <tag>out.subject = "2";</tag>
      </item>
      <item>
        <one-of>
          <item>
            production
          </item>
          <item>
            audio
          </item>
        </one-of>
        <tag>out.subject = "3";</tag>
      </item>
      <item>
        <one-of>
          <item>
            development
          </item>
          <item>
            voice x m l
          </item>
        </one-of>
        <tag>out.subject = "4";</tag>
      </item>
      <item>
        tuning
        <tag>out.subject = "5";</tag>
      </item>
    </one-of>
  </rule>

</grammar>


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