3.38. param

Element typeparam
Attributesexpr | name | type | value | valuetype
Parentsobject | subdialog
ChildrenNone.
DescriptionSpecifies name/value pairs that are passed into the parent object or subdialog.

DTD

<!ELEMENT param EMPTY >
<!ATTLIST param
  name      NMTOKEN      #REQUIRED
  expr      %expression; #IMPLIED
  value     CDATA        #IMPLIED
  valuetype (data | ref) 'data'
  type      CDATA        #IMPLIED >

Language model



Attributes

expr : expression

An ECMAScript expression for the parameter value.

name : NMTOKEN

The name associated with the parameter.

type : CDATA

Specifies a MIME type (used when valuetype is ref).

value : CDATA

The parameter value.

valuetype : (data | ref) = ref

There are two value types, data and ref. The type data indicates the value is data, and ref indicates the value references an URI.

Children

None.

Examples

Example 3-44. A subdialog call parameterized with param elements
<?xml version="1.0" encoding="iso-8859-1"?>
<vxml version="1.0">
  <form>
    <subdialog name="result" src="#returnevent">
      <catch event="returnevent.event">
        <prompt>
          Received return event from subdialog, test complete.
        </prompt>
        <assign name="result" expr="true"/>
      </catch>
      <param name="param" expr="'parameter'"/>
      <prompt>
      Calling subdialog that returns an event, passing a parameter.
      </prompt>
    </subdialog>
  </form>

  <form id="returnevent">
    <var name="param"/>
    <block>
      <prompt>
      In subdialog, received <value expr="param"/>, returning event.
      </prompt>
      <return event="returnevent.event"/>
    </block>
  </form>
</vxml>

Notice that Example 3-44 shows a subdialog that returns by throwing an event. The calling dialog can catch this event. Returning by throwing an event does not fill the calling subdialog form item, however. We need explicitly fill result in the catch block. If we don't do this, the calling dialog will loop forever as result would never get filled.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.116.50.87