xml - how can i navigate to a document three times only -



xml - how can i navigate to a document three times only -

i want create vxml application in which, machine asks user employee code , checks against database. can done 3 times only. 1) inquire user employee code 2) find corresponding name code 3) if code invalid, inquire user seek 1 time again (this can done 3 times only

<?xml version="1.0" encoding = "utf-8"?> <vxml version="2.1" xml:lang="en-in" xmlns="http://www.w3.org/2001/vxml" application="lang_select.vxml"> <var name="stop" expr="stop+1"/> <var name="count" expr="1"/> <form id="ecode"> <field name="employee" type="digits?minlength=04;maxlength=04"> <prompt count="1" cond="lang=='2'"> please 4 digit employee code. </prompt> <prompt xml:lang="hi-in" count="1" cond="lang=='1'"> अपने चार अंकों कर्मचारी कोड कहिए </prompt> <prompt count="2" cond="lang=='2'"> please seek saying 4 digit employee code again. </prompt> <prompt count="2" xml:lang="hi-in" cond="lang=='1'"> फिर से अपने चार अंकों कर्मचारी कोड कह के प्रयास करें. </prompt> <prompt count="3" cond="lang=='2'"> employee code written on i-card. please or come in 4 digit employee code. </prompt> <prompt count="3" xml:lang="hi-in" cond="lang=='1'"> आपका एंप्लायी कोड आपके ई-कार्ड पे लिखा है. अपने चार अंकों कर्मचारी कोड बोलिए या दर्ज करें. </prompt> <filled> <var name="inc_count" expr="count+1"/> </filled> </field> </form> <form id="retry"> <field name="confirm" type="boolean"> <prompt cond="lang=='2'&& count &lt; 3"> <!-- machine inquire user thrice confirmation --> have entered <value expr="employee"> employee code. correct? </prompt> <prompt cond="lang=='1' && count &lt; 3" xml:lang="hi-in"> आप ने प्रवेश किया है <value expr="employee">. क्या यह सही है? </prompt> <grammar xml:lang="hi-in" version="1.0"></grammar> <filled> <if cond="confirm=='2'"> <!-- if user has given wrong employee code --> <clear namelist="employee confirm"/> <goto next="#ecode"> <elseif cond="confirm=='1'"/> <!-- if user has given right employee code --> <submit next="database.jsp" namelist="employee" method="get" /><!--<connect database --> <elseif /> <prompt cond="lang=='2'"> employee code entered invalid, please seek 1 time again later.</prompt> <prompt cond="lang=='1'" xml:lang="hi-in"> आपके द्वारा दर्ज कर्मचारी कोड अमान्य है, बाद में पुन: प्रयास करें. </prompt><!--if value of confirm undefined --> </if> </filled> <block> <if cond="stop=='4'"> <prompt cond="lang=='2'"> employee code entered invalid, please seek 1 time again later.</prompt> <prompt cond="lang=='1'" xml:lang="hi-in"> आपके द्वारा दर्ज कर्मचारी कोड अमान्य है, बाद में पुन: प्रयास करें. </prompt> </if> <prompt cond="lang=='2'"> give thanks calling! </prompt> <prompt cond="lang=='1'" xml:lang="hi-in"> फोन करने के लिए धन्यवाद! </prompt> </block> </field> </form> </vxml>

you count repetitions in same way doing in example. handle possible errors in grab block:no input, no match, , info error (your application custom event handle invalid entries). along lines:

<form> <catch event="nomatch noinput app.dataerror"> <assign name="app_count" expr="app_count + 1"/> <!-- define beforehand --> <if cond="app_count &lt; max_count/>"> please seek again. <else/> maximum number of attempts exceeded. <!-- here --> <submit namelist="..." next="..."/> </if> <reprompt/> </catch> <field name="cardnumber" type="digits?length=16"> please come in card number.</field> <subdialog name="res" namelist="cardnumber" src="..." method="post"> <filled> <if cond="res.status == 'success'"> <log> card number input success </log> <submit next="..." method="post"/> <else/> <log> card number input info error <value expr="res.status"/></log> <clear namelist="cardnumber res"/> <throw event="app.dataerror"/> </if> </filled> </subdialog> </form>

you may add together prompts count attribute too.

xml database jsp vxml

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

c# - Create a Notification Object (Email or Page) At Run Time -- Dependency Injection or Factory -

Set Up Of Common Name Of SSL Certificate To Protect Plesk Panel -