<goto>

Executes a subdialog in the current document or a different document. The <goto> element can be used to transition to a new document, a form in the current document, a form in a different document or application, or a form item in the current form.

Note: To transition to a document or a form, you must specify the destination URI.

Attributes

This section describes the attributes you can set for this element.

In VoiceXML, the <goto> element is used to:

  • Transition to form items executing within the current form. For this type of transition, Nuance recommends using either the nextitem or expritem attribute.
  • Transition to a new document (possibly a new application) or a different form in the present document. In either case, the executing form is completely abandoned. For these types of transitions, Nuance recommends using either the next or expr attribute.

Name

Data type

Default

expr

CDATA

optional

One and only one of expr, expritem, next, or nextitem must be specified or an error.badfetch error is thrown.

expritem

CDATA

optional

fetchaudio

CDATA

optional

fetchhint

(prefetch | safe)

optional

fetchtimeout

CDATA

optional

maxage

CDATA

optional

maxstale

CDATA

optional

next

CDATA

optional

nextitem

NMTOKEN

optional

expr

The expr attribute is similar to the next attribute. Specifically, it is an ECMAScript expression that evaluates to the target URI.

Note: Only one of next, nextitem, expritem, or expr may be specified.

<goto expr="URI_expression" />

To transition to a given form, you use the # symbol in the URI followed by a fragment identifier matching the id attribute of the destination form: 

<goto next="destination_document#form_id" />

expritem

The expritem attribute is an ECMAScript expression that evaluates to the name of the target form-item. It is similar to the nextitem attribute.

Note: Only one of next, nextitem, expritem, or expr may be specified.

<goto expritem="form_item_expression" /> 

fetchaudio

The fetchaudio attribute specifies the URI of the audio file to play while waiting for a document to be fetched. If you do not specify a setting for the fetchaudio attribute, the <property> element defines a value for the fetchaudio property. If the fetchaudio property is not set (default), no audio is played during a fetch. See the fetchaudio property for details.

fetchhint

The fetchhint attribute determines when content is retrieved from the server. The settings for the fetchhint attribute are:

  • prefetch—Files or dialogs are downloaded when a page is loaded.
  • safe—Files or dialogs are downloaded only when they are actually needed.

If you do not specify a setting for the fetchhint attribute, a value derived from the innermost relevant documentfetchhint <property> element is used:

<property name="documentfetchhint" value="safe"/>

fetchtimeout

The fetchtimeout attribute specifies the amount of time to wait for the content to be fetched before throwing an error.badfetch event.

The value may be specified in seconds (s) or milliseconds (ms). If no unit is specified, the value is interpreted as milliseconds by default. If no value is specified, the fetchtimeout defaults to the value set an applicable <property> element, or to the value set for the browser.loading.fetchtimeout property in the Management Station if no <property> applies. If no other default applies, the platform default of 10000 milliseconds is used.

maxage

The maxage attribute specifies the maximum amount of time a fetched resource may remain in the locale cache without requiring a server revalidation. If a value for the maxage attribute is not specified, revalidation will occur after the expiration of the freshness lifetime (as defined in RFC 2616).

maxstale

The maxstale attribute specifies the maximum amount of time a stale file remains valid before a refetch is required. If a value for the maxstale attribute is not specified, the stale document is refetched.

next

The next attribute specifies a literal string for the destination URL:

<!--Transitions to the first <form> on the document.vxml document. This action may have the additional side affect of web server revalidation or loss of document/application variables depending upon the origin of the <goto>.-->
<goto next="document.vxml" />
<!-- Similar to the first transition, but this one transitions to the <form> with ID 'Form' on the target page.-->
<goto next="document.vxml#Form" />
<!-- Transition to the <form> with ID 'Form' located within the current document. No server revalidation takes place, and document/application variables are retained.-->
<goto next="#Form" />

Note: Only one of next, nextitem, expritem, or expr may be specified.

nextitem

To transition to a form item in the current form, you can use the nextitem or expritem attribute to specify the destination form item. The nextitem attribute specifies a literal string. The literal string represents the name of the next form item that will be visited in the current form:

<goto nextitem="form_item_name" /> 

Note: Only one of next, nextitem, expritem, or expr may be specified.

Children

None.

Parents

Sample code

<block>
    <if cond="name == null">
        <goto next="#get_personal_info"/>
    <else/>
        <submit next="log_request" method="post" namelist="name
        rank serial_number"/>
    </if>
</block>