| VoiceXML 2.1 Development Guide | Home | Frameset Home |
|
<field> and <grammar> elements. Lets examine our 'traditional' code structure, and then decide how using a server side backend for our grammar can improve things:
<?xml version="1.0" encoding="UTF-8"?>
<vxml version = "2.1" >
<meta name="maintainer" content="yourEmail@somewhere.com"/>
<form id="Stan">
<field name="Kubrick">
<grammar src="dynamic.cfm#KUBRICK" type="text/gsl"/>
<prompt>
What is your favorite Stanley Kubrick movie?
</prompt>
<filled namelist="Kubrick">
<if cond="Kubrick == 'two thousand one'">
<prompt>
Open the pod bay doors hal.
</prompt>
<elseif cond="Kubrick == 'clockwork orange'"/>
<prompt>
Viddy well, little droogies.
</prompt>
<elseif cond="Kubrick == 'doctor strangelove'"/>
<prompt>
Precious. Bodily. Fluids!
</prompt>
<elseif cond="Kubrick == 'the killing'"/>
<prompt>
Put the money in the bag!
</prompt>
<elseif cond="Kubrick == 'lolita'"/>
<prompt>
Humbert Humbert is thinking bad thoughts.
</prompt>
<elseif cond="Kubrick == 'barry lydon'"/>
<prompt>
Pistol duelling is best left to those who can hit what they aim at.
</prompt>
<elseif cond="Kubrick == 'day of the fight'"/>
<prompt>
Put up your dukes.
</prompt>
<elseif cond="Kubrick == 'the shining'"/>
<prompt>
Danny's not here missus Torrance!
</prompt>
<else/>
</if>
</filled>
</field>
</form>
</vxml>
KUBRICK [
[two thousand one] {<KubrickMovie "two thousand one">}
]
<CFQUERY NAME="q1" DATASOURCE="Kubrick">
SELECT * FROM KubrickTable
</CFQUERY>
KUBRICK [
<CFOUTPUT query="q1">
(#Title#) {<KubrickMovie "#Title#">}
</CFOUTPUT> ]
<CFQUERY NAME="q1" DATASOURCE="Kubrick">SELECT * FROM KubrickTable</CFQUERY>KUBRICK [ <CFOUTPUT query="q1">(#Title#) {<KubrickMovie "#Title#">} </CFOUTPUT> ] KUBRICK[
(two thousand one) {<KubrickMovie "two thousand one">}
(doctor strangelove) {<KubrickMovie "doctor strangelove">}
(the killing) {<KubrickMovie "the killing">}
(lolita) {<KubrickMovie "lolita">}
(full metal jacket) {<KubrickMovie "full metal jacket">}
(eyes wide shut) {<KubrickMovie "eyes wide shut">}
(paths of glory) {<KubrickMovie "paths of glory">}
(barry lydon) {<KubrickMovie "barry lydon">}
(day of the fight) {<KubrickMovie "day of the fight">}
(clockwork orange) {<KubrickMovie "clockwork orange">}
(the shining) {<KubrickMovie "the shining">}
]
| ANNOTATIONS: EXISTING POSTS |
draftbeer80
|
|
| Hi!
The explanation was vivid and clear even to a dummy like me! Hehhe. But I hope you could tell me if it is possible to create a dynamic grxml grammar using mysql? I noticed that you used <cfquery> tag to send a query to coldfusion. I was kind of wondering if there is a way to do something similar to mysql. Is that an equivalent tag for that matter? If none, then, can I include php script in my grxml grammar? If it helps, I am using voxeo prophecy 7.0 platform and I am trying to create an external grxml grammar. Thanks a bunch! Chris ;-D |
|
jbassett
|
|
| Hello.
You should be able to do something like that. There is a forum thread on this where a user gives us an example of what he was trying here. http://evolution.voxeo.com/forums/home.jsp?xt=1166705083935&bb-cid=10&bb-tid=147689&bb-name=masterforum#forum He did not get back with us as to whether he got his specific code working, but this will give you an idea using PHP and MYSQL. Thanks Jesse Bassett Voxeo Support |
|
draftbeer80
|
|
| Thank you very much jesse for your reply and thanks for pointing me to the forums. Hehhehe. I found out just now that there's a forum.
Thanks again Chris ;-D |
|
messer
|
|
| Hi,
Could the example above be done using a flat file instead of a DB? Mark |
|
voxeoJohn
|
|
| Hi Mark,
You could certainly make use of some [b]grep[/b]to pull out required fields from a flat file, that would be just one possible way of accomplishing this on the serverside. However, without some more specific examples of what you are trying to accomplish here; accurately coming up with a solutions would be slightly difficult. =] I saw that you opened up a support ticket on this very issue. If privacy and/or confidentiality is a concern please post back to that ticket with a more detailed description of what you are trying to accomplish, if not you can certainly post here to share with the 'class'. Once we have received that and we will certainly be more then happy to assist. We are always more then happy to assist all of our developers! Regards, John Customer Engineer |
|
a888333
|
|
| Do you have any sample code that will pull data using ASP from a MS Access Database? Thanks. | |
VoxeoDustin
|
|
| Hey,
Unfortunately, I do not have any samples of ASP writing to an Access database, as our ability to support the myriad of server-side offerings is somewhat limited. However, the only difference between doing this for the web and doing it with VoiceXML is that it will need to output valid VoiceXML instead of HTML. I've linked below a basic intro to combining server-side and VoiceXML, and if you need any examples of ASP and MS Access, a Google search should net plenty of options. http://www.vxml.org/qs_vars.htm Let me know if we can be of further assistance. Cheers, Dustin Hayre Customer Support Engineer 2 Voxeo Support |
| login |
|