0

I try to use grammar in my voicexml file. At first i tried an In-line grammar. I used an example from a website, but it doesn't work.

here is the code:

<?xml version="1.0" encoding="UTF-8"?> 
<vxml [...]  version="2.0">


<form id="test">

<field name="var">
<prompt>choose</prompt>

<!-- ABNF -->
<grammar> one | two | three| four </grammar>

<filled>
you chose <value expr="var"/> 
</filled>

</field>


</form>
</vxml>

thanks

Tyzak
  • 2,430
  • 8
  • 38
  • 52
  • What type of error are you getting ? And, have you verified your platform supports the ABNF format of the grammar. Many of them do not (I believe those using Nuance's ASR do not, but MS and some of the European vendors do). – Jim Rush Jan 05 '11 at 10:46

1 Answers1

3

Your VXML grammar format may not be compatible with your platform. Try this instead:

<grammar root="main" version="1.0" xml:lang="en">

  <rule id="main" scope="public">
    <one-of>
      <item>one</item>
      <item>two</item>
      <item>three</item>
      <item>four</item>
    </one-of>
  </rule>

</grammar>

instead of...

<grammar> one | two | three| four </grammar>
BG100
  • 4,481
  • 2
  • 37
  • 64
  • 1
    That is a valid ABNF grammar format. Now, the platform may not support ABNF as many do not. – Jim Rush Jan 05 '11 at 10:45
  • @Jim - really? I've never seen this before! but thanks... I'll amend the answer. – BG100 Jan 05 '11 at 10:49
  • 1
    It's covered in the SRGS specification (http://www.w3.org/TR/speech-grammar/), just scan for ABNF. I had to implement an ABNF grammar handler(already had the XML flavor covered) for one of my products as well as adding SISR support (both literal and ECMAScript formats). – Jim Rush Jan 05 '11 at 14:34