| VoiceXML 2.1 Development Guide | Home | Frameset Home |
| expr | Data Type: CDATA | Default: Optional |
| The expr attribute equates to an ECMAScript value that defines the value for the parameter. Of note is the fact that expr and value are mutually exclusive attributes. | ||
| index | Data Type: CDATA | Default: Optional |
| The index attribute, used when invoking an object, is used by the developer to specify a particular index reference in an array of parameters. | ||
| name | Data Type: NMTOKEN | Default: Optional |
| The name attribute specifies the name of the parameter to be passed to the destination URI. | ||
| type | Data Type: CDATA | Default: Optional |
| The type attribute is only relevant when used in conjunction with the object element, and specifies the MIME type of the destination object. | ||
| value | Data Type: CDATA | Default: Optional |
| The value attribute specifies the literal string value of the parameter getting passed to the destination URI. | ||
| <?xml version="1.0" encoding="UTF-8"?> <vxml version = "2.0"> <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="F1"> <subdialog name="SubD_1" src="MySubD.vxml"> <param name="confirm_prompt" expr="'should vin diesel think about another profession?'"/> <filled> <prompt> yeah, you are probably right. </prompt> </filled> </subdialog> </form> </vxml> |
| <?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="F1"> <var name="confirm_prompt"/> <var name="response"/> <field name="field_confirm" type="boolean"> <prompt> <value expr="confirm_prompt"/> </prompt> <filled> <if cond="field_confirm == true"> <assign name="response" expr="'yes'"/> <else/> <assign name="response" expr="'no'"/> </if> <return namelist="response"/> </filled> </field> </form> </vxml> |
| ANNOTATIONS: EXISTING POSTS |
Lampei
|
|
| Shouldn't "parent" be subdialog, not param? | |
MattHenry
|
|
| Eeep! You got me on this one; I had the element listed as a valid parent, but not actually enabled for the Motorola docset. This is fixed in our internal build of the docs, and should be reflected on the live site within the next 24 hours.
Thanks for the catch! ~Matt |
|
vinayagan
|
|
| Hi,
I belive param is a child of object also..Our document has specified only subdialog and param Thanks Nayagan |
|
mikethompson
|
|
| Hi Nayagan,
You are correct, <object> is indeed a parent of <param>. Unfortunately, Voxeo does not support the use of the <object> element, so I presume that is why it was left out of the documentation as a reference. Best, Mike Thompson Voxeo Corporation |
|
mtatum111
|
|
| I am a little confused with the attributes of value and expr. I was thinking that expr was used to hold the name. However, it looks like it actually contains the value of what is being sent.
can you give an example of expr and value so that I can hopefully understand the differences. Thanks |
|
VoxeoDustin
|
|
| Hey Melissa,
The name is actually held in the 'name' attribute. value and expr are similar, in that they pass the actual value of the parameter, however, 'value' is for a literal string value, and expr is for an ECMAScript expression: Value: <param name="my_param" value="foobar"/> Expr: <var name="var_1" expr="foo"/> <var name="var_2" expr="bar"/> <param name="my_param" expr="var_1 + var_2"/> Cheers, Dustin |
|
mtatum111
|
|
| Dustin, thanks for the clarification. In that case, for the above example that is given
<form id="F1"> <subdialog name="SubD_1" src="MySubD.vxml"> <param name="confirm_prompt" expr="'should vin diesel think about another profession?'"/> <filled> <prompt> yeah, you are probably right. </prompt> </filled> </subdialog> </form> shouldn't param be the following since it is a litteral. <param name="confirm_prompt" value="'should vin diesel think about another profession?'"/> |
|
VoxeoDustin
|
|
| Hey Melissa,
Since the string is enclosed in single quotes, this is in fact a valid ECMAScript expression. However, it would make more sense to use value here since it is a literal string. Thanks, Dustin |
|
mtatum111
|
|
| Dustin, thanks as always for the explanation. | |
mtatum111
|
|
| what happens if you have the following
<param name="temp1" value="24" then in your subdialog you have <var name="temp1" expr="45" /> I am assuming that temp1 will now have a value of 45 in the subdialog as long as you are in there(since it has been "re-assigned" this new value)? Of course, after returning from the subdialog, this variable is non-existent. Is that the case? |
|
voxeojeremyr
|
|
| Hi Melissa,
You are absolutely correct. Of course if you had previously defined the variable temp1 before the subdialog as say '15' it would revert to that value. Regards, Jeremy Richmond Voxeo Support |
| login |