| VoiceXML 2.1 Development Guide | Home | Frameset Home |
|
<field>, will default to the fieldname itself. The use of grammar slots comes in handy when we want to reuse a grammar in more than one <field>, as evidenced in the example below:<?xml version="1.0"?>
<vxml version="2.0">
<form>
<field name="F_1" slot="MySlot">
<grammar src="GrammarFile.gsl#MYRULE" type="text/gsl"/>
<prompt>
what is your favorite cheese?
</prompt>
<filled>
<prompt>
You said <value expr="F_1$.interpretation.MySlot"/>
</prompt>
<goto nextitem="F_2"/>
</filled>
</field>
<field name="F_2" slot="MySlot">
<grammar src="GrammarFile.gsl#MYRULE" type="text/gsl"/>
<prompt>
what is your least favorite cheese?
</prompt>
<filled>
<prompt>
You said <value expr="F_2$.interpretation.MySlot"/>
</prompt>
</filled>
</field>
</form>
</vxml>
MYRULE [
[cheddar] {<MySlot "cheddar">}
(?monteray jack) {<MySlot "jack">}
(+stinky french cheese) {<MySlot "stinky">}
]
| ANNOTATIONS: EXISTING POSTS |
| login |
|