Element type | one-of |
Attributes | xml:lang |
Parents | item | rule |
Children | item |
Description | Indicates a set of possible choices for a phrase in a rule expansion. |
<!ELEMENT one-of (item)* > <!ATTLIST one-of xml:lang NMTOKEN #IMPLIED >
xml:lang : NMTOKEN
Specifies the spoken language used with this element - for example, en-US for US English.
item
Each choice within a one-of element is represented by an item element containing a rule expansion.
In Example 3-41, the rule uses the one-of elements to accept either "like" or "hate" and either "dogs" or "cats." Hence it will match the following phrases:
I like dogs.
I hate dogs.
I like cats.
I hate cats.
<?xml version="1.0" encoding="iso-8859-1"?> <vxml version="2.0"> <form id="test"> <initial name="dogscats"> <prompt>How do you feel about dogs and cats?</prompt> </initial> <grammar xml:lang="en-US" version="1.0" root="colors"> <rule id="colors" scope="public"> <one-of> <item tag="emotion='like';">like</item> <item tag="emotion='hate';">hate</item> </one-of> <one-of> <item tag="animal='dogs';">dogs</item> <item tag="animal='cats';">cats</item> </one-of> </rule> </grammar> <field name="emotion"/> <field name="animal"/> <filled> <prompt> You said you <value expr="emotion"/> <value expr="animal"/>. </prompt> </filled> </form> </vxml> |
18.226.164.75