# <param>

Description

Specifies values that are passed into `<object>` or into `<subdialog>`. When `<param>` is contained in a `<subdialog>` element, the values specified are used to initialize `<var>` declarations in the subdialog that is invoked. The initialization takes precedence over the expr attribute in `<var>`.

Note: The values passed into a `<subdialog>` (using `<param>`) can be strings or any ECMAScript values (ex. numbers, pointers, objects, arrays, etc.).

Syntax

    <param
        name="string"
        value="string"
        expr="ECMAScript_Expression"
        valuetype="data" | "ref"
        type="MIME_type"/>

Attributes

Attribute | Description
name | The name associated with the parameter. Required.
value | The string value of the parameter. Exactly one of value or expr must be specified.
expr | An ECMAScript expression to be evaluated and used as the parameter value. Exactly one of value or expr must be specified.
valuetype | Indicates the type of the value. Optional. (Defaults to data.) data - value is actual data ref - value is referenced by a URI Note: This attribute is only relevant for uses of `<param>` in `<object>` (i.e. it is not used with `<subdialog>`).
type | The media type of the result provided by a URI if `valuetype="ref"`. Optional Note: This attribute is only relevant for uses of `<param>` in `<object>` (i.e. it is not used with `<subdialog>`).

Attribute Notes

- An `error.badfetch` event is thrown if more or less than one of `value` and `expr` are specified.

Parents

<object>, <subdialog>

Children

None.

Extensions

None.

Limitations/Restrictions

None.

Example

Document that calls the subdialog:

    <?xml version="1.0"?>
    <vxml version="2.0" xmlns="http://www.w3.org/2001/vxml">
      <form>
        <subdialog name="result" src="subdialog.vxml">
          <param name="birthday" expr="'2000-02-10'"/>
          <param name="age" value="100"/>
        </subdialog>
      </form>
    </vxml>

Document containing the subdialog:

    <?xml version="1.0"?>
    <vxml version="2.0" xmlns="http://www.w3.org/2001/vxml">
      <form id="getdriverslicense">
        <var name="birthday"/>
        <var name="age"/>
        <block>
          Hello, your birthday is <value expr="birthday"/>
          and you are <value expr="age"/> years old.
          <return/>
        </block>
      </form>
    </vxml>