ruleref element
VoiceXML 2.0
References a rule element.

Syntax

<ruleref
uri = "string"
/>

Attributes
uri
The URI to a rule.

Parents
item, rule

Children
None.

Examples

The following example defines a ruleref that demonstrates a simple yes-no grammar. The grammar is composed of two subgrammars - a yes grammar and a no grammar.

<grammar xml:lang="en-US" 
         type="application/srgs+xml" 
         version="1.0" 
         mode="voice" 
         tag-format="semantics/1.0"
         root="yes_no">
   <rule id="yes_no" scope="public"> 
      <one-of>
         <item>
            <ruleref uri="#yes"/> 
         </item>
         <item>
            <ruleref uri="#no"/>
         </item>
      </one-of>
   </rule>

   <rule id="no" scope="private"> 
      <one-of>
         <item>no</item>
         <item>negative</item>
         <item>nope</item>
         <item>absolutely not</item>
      </one-of>
      <tag>out = "no";</tag>
   </rule>

   <rule id="yes" scope="private">
      <one-of>
          <item>yes</item>
          <item>okay</item>
          <item>affirmative</item>
          <item>absolutely</item>
      </one-of>
      <tag>out = "yes";</tag>
   </rule>
</grammar>


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