<goto>

Goes to another location in the same or different document.

Syntax

 <goto
     next="URI"
     expr="js_expression"
     expritem="js_expression"
     nextitem="URI"
     fetchhint="prefetch"|"safe"
     fetchtimeout="time_interval"
     fetchaudio="URI"
     maxage="time_interval" 
     maxstale="time_interval" 
 />

Description

Transitions to another item in the same form, to another dialog in the same document, or to a different document. Except when the transition is to another item in the same form, the transition will cause all values stored in the dialog's variables to be lost. This is true even if you transition into the same dialog as you were in before.

The VoiceXML interpreter clears its prompt queue when transitioning to another form item. You will not be able to bargein during prompts played in the execution of a <goto> tag.

Attribute Description
next

The URI to go to next. Optional (as alternative to expr, expritem, nextitem).

expr

JavaScript expression that evaluates to the URI to go to next. Optional (as alternative to next, expritem, nextitem).

expritem

JavaScript expression that evaluates to the name of the next item in the current form to visit next. Optional (as alternative to next, expr, nextitem).

nextitem

Name of the next item in the current form to visit next. Optional (as alternative to next, expr, expritem, nextitem).

fetchhint

Specifies whether the interpreter can attempt to optimize dialog interpretation by prefetching the resource. See Prefetching Resources. Optional.

fetchtimeout

Specifies the interval to wait for the resource to be returned before throwing a error.badfetch event. See Handling Fetching Delays. Optional.

fetchaudio

Specifies the URI of background audio to be played during fetching. Note that this attribute and related properties affect whether queued prompts are played first. See Background Audio for important details. Optional.

maxage

New in VoiceXML 2.0. Specifies the maximum acceptable age, in seconds, of the cached resource. See Maximum Age. Optional.

maxstale

New in VoiceXML 2.0. Specifies the maximum acceptable time, in seconds, during which an expired cached resource can still be used. See Maximum Stale Time. Optional.

One and only one of the attributes next, expr, nextitem, and expritem must be specified.

Tip:

 •  If a JavaScript expression contains any of the characters "<", ">", or "&", that character must be replaced with the corresponding escape sequence "&lt;", "&gt;", or "&amp;". For more information, see JavaScript Quick Reference.

Usage

Parents Children
<bevocal:foreach>
<block>
<catch>
<error>
<filled>
<help>
<if>
<noinput>
<nomatch>

None.

See Also

 •  VoiceXML 2.0 Specification: <goto>
 •  Related tag: <submit>

Examples

 <?xml version="1.0" ?>
 <!DOCTYPE vxml PUBLIC "-//BeVocal Inc//VoiceXML 2.0//EN"
  "http://cafe.bevocal.com/libraries/dtd/vxml2-0-bevocal.dtd">
 <vxml version="2.0" xmlns="http://www.w3.org/2001/vxml">
   <var name="something" expr="500"/>
   <form id="form1">
     <block>
     <var name="something" expr="6000"/>
       <prompt>
         Something is <value expr="something"/> Going to the second dialog.
       </prompt>
       <goto next="#form2"/>
       <!-- You should not hear this prompt. -->
       <prompt>goto failed</prompt>
     </block>
   </form>
   <form id="form2">
     <block>
       <prompt>
         You are now in the second dialog. Something is now
         <value expr="something"/> Thank you.
       </prompt>
     </block>
   </form>
 </vxml>

[Show Frames]   [FIRST] [PREVIOUS] [NEXT]
BeVocal, Inc. Café Home | Developer Agreement | Privacy Policy | Site Map | Terms & Conditions
Part No. 520-0001-02 | © 1999-2007, BeVocal, Inc. All rights reserved | 1.877.33.VOCAL