Subdialogs are a mechanism for reusing common dialogs and building libraries of reusable applications.
| name | The result returned from the subdialog, an ECMAScript object whose properties are the ones defined in the namelist attribute of the <return> element. |
| cond | (defaults to true) An expression that must evaluate to true after conversion to Boolean in order for the event to be caught. |
| expr | The initial value of the form item variable; default is ECMAScript undefined. If initialized to a value, then the form item will not be visited unless the form item variable is cleared. |
| src | The URI of the subdialog. |
| srcexpr | An ECMAScript expression yielding the URI of the subdialog. |
| fetchhint | This attribute is not supported. |
| fetchtimeout | (defaults to "fetchtimeout" global property value) The timeout for fetches. Must be specified with the appropriate time units (e.g., "120s" for 120 seconds). |
| maxage | (defaults to "documentmaxage" global property value) Tells the platform the maximum acceptable age, in seconds, of cached documents. |
| maxstale | (defaults to "documentmaxstale" global property value) Tells the platform the maximum acceptable staleness, in seconds, of expired cached documents. |
| fetchaudio | (defaults to "fetchaudio" global property value) The URI of the audio clip to play while the fetch is being done. |
| method | (defaults to "get") The request method: get or post. |
| enctype | (defaults to "application/x-www-form-urlencoded") The media encoding type of the submitted document. Can also be set to "multipart/form-data". |
| namelist | The list of variables to submit. The default is to submit no variables. If a namelist is supplied, it may contain individual variable references that are submitted with the same qualification used in the namelist. Declared VoiceXML and ECMAScript variables can be referenced. |
Exactly one of "src" and "srcexpr" must be specified.
<?xml version="1.0"?>
<vxml version="2.1">
<form>
<subdialog name="blah" src="subdialog.php"/>
<block>
Hello <value expr="blah.stuff"/>.
</block>
</form>
</vxml><?php
header("Content-type: text/xml");
echo("<?xml version=\"1.0\"?>\n");
$somevar = "World";
?>
<vxml version="2.0">
<form>
<block>
<var name="stuff" expr="'<?php echo($somevar)?>'"/>
<return namelist="stuff"/>
</block>
</form>
</vxml>The output of the above script would be:
Computer: Hello World.
<audio>, <catch>, <enumerate>, <error>, <filled>, <help>, <noinput>, <nomatch>, <param>, <prompt>, <property>, <value>