We've Moved! Please visit our new and improved forum over at our new portal: https://portal.plumvoice.com/hc/en-us/community/topics

Weird grammar error

Questions and answers about IVR programming for Plum DEV

Moderators: admin, support

Post Reply
sightplan
Posts: 17
Joined: Wed Feb 25, 2015 3:47 pm

Weird grammar error

Post by sightplan »

Hey guys,


I'm getting a really strange grammar error that I'm just not seeing the root cause for:

Error creating grammar
Message from ASR engine:
---------
SWI_PARSER_XERCES_ERROR| XML syntax error| STRING_GRAMMAR | In XML grammar at line 3 char 6: No processing instruction starts with 'xml'
---------




This happens when I invoke the grammar from a field with the following parameters set, and I try and enter a DTMF input (which should be disallowed in the first place, per my property settings). Worth noting that I do have a single <link> grammar active at the application scope, but aside from this there are no other grammars active, and I have unsuccessfully tried setting modal to 'true' within the field to see if this makes a difference:


APPROOT LINK GRAMMAR:

Code: Select all

 <link expr="application.basePath + 'recordVM.xml'" dtmf="0">
 </link>



INVOKING DIALOG:

Code: Select all

  <field name="loopResName" slot="boolSlot">
  <property name="inputmodes" value="voice"/>
   <grammar type="application/srgs+xml" srcexpr="'boolGrammar.xml'" mode="voice"/>

    ...
  </field>

BOOLGRAMMAR.XML

Code: Select all

<?xml version="1.0"> 
<grammar type="application/srgs+xml" root="BOOL" xml:lang="en-US" mode="voice">
  <rule id="BOOL">
  
   <one-of>
    <item>
     <one-of>
      <item>yes</item>
      <item>yeah</item>
      <item>yep</item>
      <item>yup</item>
      <item>sure</item>
      <item>surely</item>
      <item>fine</item>
      <item>okay</item>
      <item>all right</item>
      <item>right</item>
      <item>thats right</item>      
      <item>correct</item>
      <item>thats correct</item>
      <item>uh huh</item>
      <item>yepper</item>
      <item>affirmative</item>
      <item>yes please</item>
     </one-of>
     <tag>boolSlot="true";</tag> 
   </item>

    <item>
     <one-of>
      <item>no</item>
      <item>no way</item>
      <item>wrong</item>
      <item>incorrect</item>
      <item>nope</item>
      <item>nah</item>
      <item>thats wrong</item>
      <item>thats incorrect</item>
      <item>no thanks</item>
      <item>negative</item>
      <item>negatory</item>
      <item>cancel</item>
      <item>never</item>
     </one-of>
     <tag>boolSlot="false";</tag> 
   </item>
   
   </one-of>
 </rule>

</grammar>
Any advice on what the root cause is, and what I can do to address this would be much appreciated.


Thanks,

Matt

support
Posts: 3632
Joined: Mon Jun 02, 2003 3:47 pm
Location: Boston, MA
Contact:

Re: Weird grammar error

Post by support »

Hi Matt,

From your call logs, it seems like you are trying to try to load your grammar from the scratchpad. Keep in mind, scratchpads are designed to be simple, one-page hosted VoiceXML scripts, not grammar files. They can be used to create application prototypes and test out new code ideas, but they should not be used to run large production VoiceXML applications.

As an alternative, consider hosting these scripts on your own application server, or use the File Repository instead. You can find the File Repository under the "Applications" menu drop-down within the Plum Dev hosting interface.

Regards,
Plum Support

sightplan
Posts: 17
Joined: Wed Feb 25, 2015 3:47 pm

Re: Weird grammar error

Post by sightplan »

Hi again,

Thanks for the reply. I've moved hosting to the file repository, and I'm still seeing the same error. I am not understanding how this error would be host-specific, as the error is coming from the ASR.

Code: Select all

(200024;012;1433773727) [inet] EVENT: Attempting to fetch http://repo.local.plumgroup.com/root/fda1ad802c653941219617405c1a7c33/VXML/boolGrammar.xml
(200024;012;1433773727) [rec] ERROR: Error creating grammar
(200024;012;1433773727) [vxi] EVENT: received event: error.grammar: 
Thanks.

support
Posts: 3632
Joined: Mon Jun 02, 2003 3:47 pm
Location: Boston, MA
Contact:

Re: Weird grammar error

Post by support »

Hi Matt,

You are missing a "?" in the xml declaration in your boolGrammar.xml file that might account for the error you are seeing:

The following line:

Code: Select all

<?xml version="1.0">
should be:

Code: Select all

<?xml version="1.0"?>
Could you let us know if this resolves the issue?

Regards,
Plum Support

sightplan
Posts: 17
Joined: Wed Feb 25, 2015 3:47 pm

Re: Weird grammar error

Post by sightplan »

Oh my, thats a boneheaded move on my part. Thanks for catching that one; it did fix the issue entirely.

Post Reply