| 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 |
| login |
|