Plum DEV Documentation
voicexml:tags:rule

<rule>

An SRGS+XML rule definition is contained within a <rule> block.

Attributes

id This attribute specifies the rulename for the rule.
scope Can be either “public” or “private”.

Notes

For examples and usage information, please refer to the Speech Recognition Grammar Specification.

Example

<?xml version="1.0"?>
<vxml version="2.0">
  <form>
    <field name="animal">
      <grammar type="application/srgs+xml" root="ROOT" mode="voice">
        <rule id="ROOT">
          <one-of>
            <item>Dog</item>
            <item>Cat</item>
          </one-of>
        </rule>
      </grammar>
      <prompt>
        Say either dog or cat.
      </prompt>
      <filled>
        <prompt>
          You said <value expr="animal"/>. Goodbye.
        </prompt>
        <exit/>
      </filled>
    </field>
  </form>
</vxml>

The output of the above script would be:

Computer: Say either dog or cat.
Human: Dog.
Computer: You said dog.

Child Tags

Parent Tags