| VoiceXML 2.1 Development Guide | Home | Frameset Home |
|
menu and option elements to keep the code nice and compact. However, if you have more complicated grammar/subgrammar structures that contain a lot of options, then you might well want to go with an external grammar reference in order to reduce clutter in your VXML documents.
<property name="grammarfetchint" value="prefetch"/>
<grammar src="MyGrammar.cfm#MYRULE" type="application/grammar-xml"/>
<?xml version= "1.0"?>
<grammar xmlns="http://www.w3.org/2001/06/grammar" xml:lang="en-US" root = "MYRULE">
<cfheader name="Cache-Control" value= "no-cache">
<cfheader name="Expires" value="#Now()#">
<cfcontent type = "text/almost_plain">
<rule id="MYRULE" scope="public">
<one-of>
<item> tricky <tag> <![CDATA[ <MySlot "Run DMC"> ]]> </tag> </item>
</one-of>
</rule>
</grammar>
<cfcontent type = "text/almost_plain">
response.setHeader("Content-type", "application/x-gsl");SetContentType("text/html; charset=XXXXX");header('Content-type: application/x-nuance-gsl');print "Content-type: text/html\n\n";<cfcontent type = "text/almost_plain">| ANNOTATIONS: EXISTING POSTS |
agonzalez
|
|
| is the example ok?
<rule id="MYROOT" scope="public"> should be : <rule id="MYRULE" scope="public"> or <grammar src="MyGrammar.cfm#MYRULE" type="text/gsl"/> should be : <grammar src="MyGrammar.cfm#MYROOT" type="text/gsl"/> where is #myrule pointing? from the grammar src="MyGrammar.cfm#MYROOT" |
|
mikethompson
|
|
| Hello Angel,
I believe you have found a typo here. Either way would work as long as the rule id matched the anchor on the grammar reference. So, if the grammar src was #MYRULE then the rule id in the grammar should be MYRULE as well. As it stands now, #Myrule is pointing nowhere because the rule id is not the same. I'll alert the keepers of the documentation to see that they implement a fix in the next internal build. Regards, Mike Thompson Voxeo Extreme Support |
|
Khamyl
|
|
| Good day!
If we are speaking about grXML format, shouldn't there be <grammar src="MyGrammar.cfm#MYRULE" type="text/application-xml"/> or something related to grXML instead of <grammar src="MyGrammar.cfm#MYRULE" type="text/gsl"/> And one more thing!.. why we do not define any 'type' atribute in <grammar> tag in myGrammar.cfm file? THX! Khamyl |
|
MattHenry
|
|
|
Hello again Khamyl, Let's address the questions one-by-one, shall we? - Regarding the 'type' specified in the example, this is illustrative of a bad copy/paste on my part. You are correct in that this really should be defined as "application/grammar-xml" for this specific SRGS grammar. - In reference to your comment about the 'type' not being specified within the extrnal file itself, note that this is really only required when referncing an external grammar; this attribute is only required in the grammar invocation, not within the file itself. Hope this clears things up, ~Matthew Henry |
| login |
|