item element
VoiceXML 2.0
Defines an expression that can be uttered by the user.

Syntax

<item
repeat = "string"
weight = "string"
/>

Attributes
repeat
A legal rule expansion that defines the contained expansion as being optional,being repeated zero or more times, being repeated one or more times, or being repeated some range of times.
0-1 Indicates that the contained expression is optional.
m- Indicates that the contained expression is repeated "m" times or more (inclusive). "m" most be "0" or a positive integer.
m-n Indicates that the contained expression is repeated between "m" and "n" times (inclusive). "m" and "n" must both be "0" or a positive integer and "m" must be less than or equal to "n".
n Indicates that the contained expression is repeated exactly "n" times. "n" must be "0" or a positive integer.
weight
A floating point value greater than or equal to zero indicating the likelihood that the user will utter the item. If the weight is not specified, the choices are assumed to be equally likely.

Parents
item, one-of, rule

Children
item, one-of, ruleref

Examples

The following example uses the item element to allow the user to select the name of a fruit. If the user says "apple", the recognizer returns "1". If the user says "orange", the recognizer returns "2". If the user says "pear", the recognizer returns "3."

<grammar xml:lang="en-US" 
         type="application/srgs+xml" 
         version="1.0" 
         tag-format="semantics/1.0"
         root="fruit"
         mode="voice">
   <rule id="fruit" scope="public">
     <one-of>
       <item>
          apple
          <tag> out = "1"; </tag>
       </item>
       <item>
         orange
         <tag> out = "2"; </tag>
       </item>
       <item>
         pear
         <tag> out = "3"; </tag>
       </item>
     </one-of>
   </rule>
</grammar>


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