VoiceXML 2.1 Development GuideHome  |  Frameset Home

  grXML Built-in Grammars  |  TOC  |  grXML Multislot Grammars  

XML Slot-defined Grammars

Defining a specific slot value for an XML grammar is just as easy as with GSL. Our example of a GSL grammar with slots explicitly defined looks like this:

MYRULE    [
[cheddar]                                {<MySlot "cheddar cheese">}
(monteray jack)                    {<MySlot "jack cheese">}
(stinky french cheese)        {<MySlot "stinky cheese">}
                ]



When we want to achieve the same thing with XML grammars, we simply nest the slot assignation and grammar return within both the <tag> element, and within a CDATA block:


<?xml version= "1.0"?>
    <grammar xmlns="http://www.w3.org/2001/06/grammar"
                      xml:lang="en-US" root = "MYRULE">

      <rule id="MYRULE">
        <one-of>
          <item> cheddar <tag> <![CDATA[  <MySlot "cheddar cheese"> ]]>  </tag> </item>
          <item> monteray jack <tag> <![CDATA[  <MySlot " jack cheese"> ]]>  </tag> </item>
          <item> stinky french cheese <tag> <![CDATA[  <MySlot "stinky cheese"> ]]>  </tag> </item>
        </one-of>
      </rule>
    </grammar>


So, when a user utters 'cheddar' the returned interpretaion value will be 'cheddar cheese', rather than 'cheddar'. pretty easy, no?




  ANNOTATIONS: EXISTING POSTS
Khamyl
7/10/2006 5:17 PM (EDT)
Hi,
Two examples above are not equal if we consider the optional and repeat operator in GSL format. Are they?

How should grXML formated grammar look like if we want it to be equivalent with GSL format considering operators.

Thank you.
Khamyl
MattHenry
7/10/2006 5:29 PM (EDT)


Hello Khamyl,

You are indeed correct. Apologies if this slight misrepresentation caused any confusion. I'll see that this is corrected in the next Build of the VXML docs.

~Matthew Henry
lily
12/26/2007 1:24 PM (EST)
I used the converter to convert the gsl grammar to the grXML one. The way to get the slots are really different, in the beginning they create a function to be able to get the slots. Is there an easier way like in the gsl one?

When I used the example you provided for the grXML it didn't work out.

Thanks!
VoxeoTony
12/26/2007 10:05 PM (EST)
Hello,

You spoke of a converter, unfortunately, I'm not entirely sure of what converter you are referring to in your posting.  We do also see that you are looking to continue the process of getting the grXML grammar slot functionality to work.

We would want to know more information about this tutorial not working for you.  It was tested stringently prior to being published on the tutorials page.  In addition, I ran a follow up test to be sure it was operational.  However, this doesn't mean that you aren't experiencing issues.  We would like to offer you the opportunity to create an account ticket under your account in order for us to help troubleshoot this issue with you.  Having the account ticket open will allow you to send us the logging data that would be paramount in our discovery efforts without compromising personal information.



Cheers,

Tony

login
  grXML Built-in Grammars  |  TOC  |  grXML Multislot Grammars  

© 2008 Voxeo Corporation  |  Voxeo IVR  |  VoiceXML & CCXML IVR Developer Site