| VoiceXML 2.1 Development Guide | Home | Frameset Home |
| cond | Data Type: CDATA | Default: Optional (true) |
| The cond attribute specifies a Boolean expression, which must equate to ‘true’ in order for the content to be visited and executed. (Additionally, the expr attribute must also be set to ‘undefined’, see below). | ||
| expr | Data Type: CDATA | Default: Optional |
| The expr attribute specifies the initial value of the element; if this value is ‘undefined’, (default), then the element will be visited by the FIA and executed. If this attribute has a value other than ‘undefined’, then the element will not be visited until explicitly set to 'undefined', by use of the clear element. | ||
| name | Data Type: NMTOKEN | Default: Optional |
| This contains the value, or ‘ID’ of the block in question, which is used for navigational purposes within the application. In order to goto a specific block in an application, a block name is required. | ||
| <?xml version="1.0" encoding="UTF-8"?> <vxml version = "2.1"> <meta name="author" content="Matthew Henry"/> <meta name="copyright" content="2005 voxeo corporation"/> <meta name="maintainer" content="YOUR_EMAIL@HERE.COM"/> <form id="F_1"> <block name="B_1" expr="'someValue'"> <prompt> since the expression of the block is not undefined, this will be skipped by the interpreter. </prompt> </block> <block name="B_2" cond="false"> <prompt> since the condition attribute is not set to true, this block will be skipped as well. </prompt> </block> <block name="B_3" cond="true" expr=""> <prompt> since the condition attribute is set to true, and the expression is set to undefined this block will be visited. </prompt> </block> </form> </vxml> |
| ANNOTATIONS: EXISTING POSTS |
mihai.paiu
|
|
| Hello there.
I saw a lot of VXML that contain blocks like the one below: <block> This is a test for a simple field </block> Should it be played (like a prompt) or just ignored ? |
|
JimMurphy
|
|
| mihai.paiu,
According to the W3C, you can leave off the <prompt> tag in two cases: 1) You do not need to specify an attribute to <prompt>. ----- eg. you need to specify a bargein value or set conditionals. In these cases, you'd need to specify a <prompt bargein="false"> or <prompt cond="var=='value'"> 2) The prompt consists entirely of PCDATA (contains no speech markups) or consists of just an <audio> or <value> element. ----- if you have any other speech markup elements in the string to be spoken, you'll have to enclose them with the parent <prompt> element. See more here: http://www.w3.org/TR/2004/REC-voicexml20-20040316/#dml4.1 I hope that helps. If not, please let us know. Jim |
|
vinoth
|
|
| Hi,
We have an example for block here and we are using one of the block attribute expr . expr value should be like this "''".It should not be like "". This is not the major pblm but new comers will face the pblm. Thanks Vinoth R |
|
ulaganathan.a
|
|
| Hi
I am new for VXML.Anybody explain about <block> in Vxml ? What is the purpose for the <block>? Ulaganathan |
|
sidvoxeo
|
|
| Hi there,
The <block> element is basically a <field> element with no variables. It contains executable content that is processed if the block's input-form-item variable is undefined and the block's cond attribute, if any, evaluates to true. After execution, its input-form-item variable is set to false so the FIA will not select the <block> element again for execution. Normally, the <block> element is executed only once. You can find more examples and detailed documentation in our docs at http://docs.voxeo.com/voicexml/2.0/ , look for the element block. Let me know if you have any questions. Thanks Sid |
|
raghu.ram
|
|
| hi,
i dont know this is a simple problem or not, im learning vxml, so im a beginner... nway how to pass a variable from one vxml file to another vxmlfile thanks --raghu |
|
voxeojeff
|
|
| Hi Raghu,
If you wish to pass variables from one file to another, there are a couple ways you can do this. 1. Declare an application root document to store your global variables 2. Pass variable information over to your other documents via the <submit> element with a namelist. For example, <submit next="SecondDocument.xml" namelist="Var1 Var2 Var3"/> This will require the use of server-side, as with most detailed applications. Cheers, Jeff Menkel Voxeo Corporation |
|
prasad123
|
|
| Hi,
I would like to know how to convert String type to number type in VoiceXML? I am trying to implement news service where it reads news and asks the user to input the no. to select the news. When the selected news is being read, if the user says "next" in between, the browser should skip the current news and start reading next news. I tried <goto nextitem> for it, but it couldn't work. Can someone help me in this? Thanks in advance, Prasad |
|
voxeojeff
|
|
| Hi Prasad,
It sounds like you should implement a bargeintype of 'hotword', along with a simple in-line GSL grammar containing the word "next" to accomplish this task. This will only recognize the word "next" and then go to the next page corresponding with the second news article. For example, <?xml version="1.0" encoding="UTF-8"?> <vxml version = "2.1"> <form id="F1"> <nomatch> <goto next="#F1"/> </nomatch> <noinput> <goto next="#F1"/> </noinput> <grammar type="text/gsl"> <![CDATA[[ [next] {<F_1 "next">} ]]]> </grammar> <field name="F_1"> <prompt bargeintype="hotword"> Your news article can go here. Only the word next will cause this to go to the next form or document. </prompt> <filled> <goto next="AnotherDocument.vxml#AnotherForm"/> </filled> </field> </form> </vxml> I hope this helps! Let me know if you have any further questions here, I will be standing by to assist. Regards, Jeff |
| login |