Page 1 of 1

Weird grammar error

Posted: Fri Jun 05, 2015 2:13 pm
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

Re: Weird grammar error

Posted: Fri Jun 05, 2015 3:44 pm
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

Re: Weird grammar error

Posted: Mon Jun 08, 2015 9:31 am
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.

Re: Weird grammar error

Posted: Mon Jun 08, 2015 9:52 am
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

Re: Weird grammar error

Posted: Mon Jun 08, 2015 10:06 am
by sightplan
Oh my, thats a boneheaded move on my part. Thanks for catching that one; it did fix the issue entirely.