I have written a VXML which for the most part works. I would like to use a grxml now instead of inline grammar.
I created icecream.grxml in the same exact directory AS MY vxml APP and i call it like this
<grammar src="icecream.grxml" type="application/srgs+xml"/>
for example
<form id="formIdicecream">
<grammar src="icecream.grxml" type="application/srgs+xml"/>
<field name="icecream"> <prompt> What is your favorite icecream? </prompt> </field>
<field name="confirm">
<prompt> Your favorite icecream is <value expr="icecream$.utterance"/> </prompt>
</field>
<block> <goto next="#formIddtmf"/> </block>
my icecream.grxml looks like below, when I run my code I get an error :
Grammar activation failed |MSG=error activating grammar|URI=icecream.grxml
#<!--Header-->
<?xml version="1.0"?>
<grammar xmlns="http://www.w3.org/2001/06/grammar"
xml:lang="en-US"
root="icecream"
mode="voice">
<!--Rules-->
<rule id="icecream">
<one-of>
<item><ruleref
uri="#vanilla" /></item>
<item><ruleref
uri="#chocolate" /></item>
<item><ruleref
uri="#strawberry" /></item>
</one-of>
</rule>
<rule id="vanilla">
<one-of>
<item>vanilla</item>
<item>nilla</item>
</one-of>
</rule>
<rule id="chocolate">
<one-of>
<item>chocolate</item>
<item>colate</item>
</one-of>
</rule>
<rule id="strawberry">
<one-of>
<item>strawberry</item>
<item>straw</item>
</one-of>
</rule>
</grammar>