Last reviewed: 3/23/2024 8:43:51 AM
<example>
An <example> element contains examples of phrases that match rule definitions along with the definition.
Syntax
<example> </example>
Attributes
none
Children
none
Parents
Example
The following example illustrates using example elements.
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE grammar PUBLIC "-//W3C//DTD GRAMMAR 1.0//EN" "http://www.w3.org/TR/speech-grammar/grammar.dtd">
<grammar xmlns="http://www.w3.org/2001/06/grammar"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.w3.org/2001/06/grammar http://www.w3.org/TR/speech-grammar/grammar.xsd"
xml:lang="En" version="1.0" mode="voice" >
<rule id="colormodel">
<example>red Camry</example>
<example>silver Accord</example>
<ruleref uri="#color" />
<ruleref uri="#model" />
</rule>
<rule id="color">
<one-of>
<item>red</item>
<item>blue</item>
<item>green</item>
<item>silver</item>
<item>black</item>
<item>white</item>
</one-of>
</rule>
<rule id="model">
<one-of>
<item>Altima</item>
<item>Camry</item>
<item>Fusion</item>
<item>Accord</item>
<item>Malibu</item>
</one-of>
</rule>
</grammar>