how to use <tag/> in grammar
Posted: Tue Apr 04, 2006 5:42 pm
Hi,
Can you please help me with the sample below? The syntax within the <tag> element works on some other voicexml platforms but doesn't seem to work the same way on the Plum platform.
The sample as-is doesn't work, it always causes the nomatch handler to be invoked. If I remove the <tag>, then recognition works but of course the references to dt.month and dt.day don't.
(Note that I'm aware there is a built in grammar for dates. I'm trying to understand the larger issue of how <tag> is supported by Plum.)
Thanks,
Kevin
Can you please help me with the sample below? The syntax within the <tag> element works on some other voicexml platforms but doesn't seem to work the same way on the Plum platform.
The sample as-is doesn't work, it always causes the nomatch handler to be invoked. If I remove the <tag>, then recognition works but of course the references to dt.month and dt.day don't.
(Note that I'm aware there is a built in grammar for dates. I'm trying to understand the larger issue of how <tag> is supported by Plum.)
Thanks,
Kevin
<?xml version="1.0" encoding="ISO-8859-1"?>
<vxml version="2.0" xmlns="http://www.w3.org/2001/vxml">
<form id="start">
<field name="dt">
<grammar version="1.0" root="main" type="application/srgs+xml" xml:lang="en">
<rule id="main" scope="public">
<item>
<ruleref uri="#month"/>
<ruleref uri="#day"/>
</item>
<tag> $.month = $month; $.day = $day; </tag>
</rule>
<rule id="month">
<one-of>
<item>May</item>
<item>June</item>
<item>October</item>
</one-of>
</rule>
<rule id="day">
<one-of>
<item>first</item>
<item>second</item>
<item>third</item>
</one-of>
</rule>
</grammar>
<prompt>Please say a date</prompt>
<filled>
<prompt>
I think you said month <value expr="dt.month"/> day <value expr="dt.day"/>.
</prompt>
<clear namelist="dt"/>
</filled>
<nomatch>
I'm sorry, I didn't catch that.
<reprompt/>
</nomatch>
</field>
</form>
</vxml>