VoiceXML 2.1 Development GuideHome  |  Frameset Home


<one-of>  element

The one-of element allows the grammar to be constructed with a series of alternate phrases or rule expansions, each of which is contained within an Item element. This element is the basic building block of any XML grammar that defines more than one valid utterance.


usage
<one-of />


attributes
none


shadow variables
none


parents
<item> <rule>


children
<item>


code samples
<OneOfCode.vxml>
<?xml version="1.0" encoding="UTF-8"?>

<vxml version = "2.1">

<meta name="author" content="Matthew Henry"/>
<meta name="copyright" content="2005 voxeo corporation"/>
<meta name="maintainer" content="YOUR_EMAIL@HERE.COM"/>


<form id="F1">

  <field name="F_1">
    <prompt>
      What is the best solution to the Oxygen channel?
    </prompt>

    <grammar src="MyOneOfGrammar.xml" type="application/grammar-xml"/>

    <filled>
      <prompt>
        Yep, you got that right.
    </prompt>

  </filled>

  </field>

</form>

</vxml>

2.0 <MyOneOfGrammar.xml>
<?xml version= "1.0"?>

<grammar xmlns="http://www.w3.org/2001/06/grammar"
        xml:lang="en-US" root = "MYRULE">

  <rule id="MYRULE" scope="public">

    <one-of>
      <item> tolerance
        <tag> <![CDATA[  <F_1 "tolerance">  ]]> </tag>
      </item>

      <item> enforced  eugenics
        <tag> <![CDATA[  <F_1 "eugenics">  ]]> </tag>
      </item>
    </one-of>
    </rule>

</grammar>



additional links
W3C SRGS 1.0 Specification


  ANNOTATIONS: EXISTING POSTS
0 posts - click the button below to add a note to this page

login



© 2008 Voxeo Corporation  |  Voxeo IVR  |  VoiceXML & CCXML IVR Developer Site