<link>

Specifies a transition common to all dialogs in the link's scope.

Syntax

 <link
     next="URI"
     expr="js_expression"
     event="event"
     dtmf="DTMF_sequence"
     eventexpr="js_expression"
     message="String"
     messageexpr="js_expression"
     fetchhint="prefetch"|"safe"
     fetchtimeout="time_interval"
     fetchaudio="URI"
     maxage="time_interval" 
     maxstale="time_interval" 
 >
   Link Grammar
 </link>

Description

Transitions to another dialog or throws an event when user input matches one of the link grammars or the DTMF sequence specified in the dtmf attribute. If the link transitions to a different dialog, execution jumps to the link's destination; if it throws an event, execution resumes in the current dialog after the event is handled.

The VoiceXML interpreter clears the prompt queue when going to another form. You will not be able to bargein during prompts played in the execution of a <link> tag that goes to another form.

Attribute Description
next

The URI to go to when user input matches one of the link grammars. Optional (as alternative to expr, event).

expr

JavaScript expression that evaluates to the URI to go to when user input matches one of the link grammars. The JavaScript expression is evaluated in the context of the JavaScript scope containing the link, not in the context of the currently active form item. Optional (as alternative to next, event).

event

The event to throw when user input matches one of the link grammars. Optional (as alternative to next, expr).

dtmf

New in VoiceXML 2.0. A DTMF sequence to activate this link. The specified sequence is equivalent to a simple DTMF grammar; the link is activated when user input matches this DTMF sequence.

This attribute can be used at the same time as child grammars.

eventexpr

New in VoiceXML 2.0. A JavaScript expression evaluating to the name of the event to be thrown.

message

New in VoiceXML 2.0. A message string providing additional context about the event being thrown. The message is available as the value of a variable within the scope of the <catch> element.

messageexpr

New in VoiceXML 2.0. A JavaScript expression evaluating to the message string.

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 next, expr, or event attributes must be specified.

(VoiceXML 1.0 only) The following attributes can be used in applications in which the version attribute of the <vxml> tag is set to 1.0.

Attribute Description
caching

VoiceXML 1.0 only. Specifies the caching policy for the resource being fetched. See Caching. Optional.

Used in place of the VoiceXML 2.0 attributes maxage and maxstale.

Tips:

 •  During application development, put a link like the following in your application root document, so that while you're calling your application you can say: "BeVocal reload" or press: *** to start the application again.
      <vxml version="2.0" xmlns="http://www.w3.org/2001/vxml">
         <link
            next="<http://www.mysite.com/myapp.vxml>"      >
            <grammar type="application/x-nuance-gsl">
            [
               (bevocal reload)
               (dtmf-star dtmf-star dtmf-star)
            ]
            </grammar>
         </link>
         ...
      </vxml>

 

 •  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
<field>
<form>
<initial>
<vxml>
<grammar>

See Also

 •  VoiceXML 2.0 Specification: <link>

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">
   <link maxage="0" next="target.vxml">
     <grammar type="application/x-nuance-gsl">
       [
         (go elsewhere)
       ]
     </grammar>
   </link>
  
   <form id="form">
     <field name="welcome">
       This is a test for link tag. You can say go elsewhere
       to load the next page of this application.
     </field>
   </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