Last reviewed: 3/23/2024 12:22:42 PM

<link>

A <link> element specifies a transition common to all dialogs in the link's scope.

Syntax

<link dtmf="dtmfsequence"
      event="event"
      eventexpr="expression"
      expr="expression"
      fetchaudio="uri"
      fetchhint="fetchtype"
      fetchtimeout="secondsormilliseconds"
      maxage="seconds"
      maxstale="seconds"
      message="string"
      messageexpr="expression"
      next="uri" />

Attributes

dtmf

The DTMF sequence for this link. It is equivalent to a simple DTMF <grammar> and DTMF properties apply to recognition of the sequence. Unlike DTMF grammars, whitespace is optional: dtmf="123#" is equivalent to dtmf="1 2 3 #". The attribute can be used at the same time as other <grammar>s: the link is activated when user input matches a link grammar or the DTMF sequence.

event

The event to throw when the user matches one of the link grammars.

eventexpr

An ECMAScript expression evaluating to the name of the event to throw when the user matches one of the link grammars.

expr

Like next, except that the URI is dynamically determined by evaluating the given ECMAScript expression.

fetchaudio

The URI of the audio clip to play while the fetch is being done. If not specified, the fetchaudio property is used, and if that property is not set, no audio is played during the fetch. The fetching of the audio clip is governed by the audiofetchhint, audiomaxage, audiomaxstale, and fetchtimeout properties in effect at the time of the fetch. The playing of the audio clip is governed by the fetchaudiodelay, and fetchaudiominimum properties in effect at the time of the fetch. The default value is the fetchaudio property.

fetchhint

Defines when the interpreter context should retrieve content from the server. If not specified, a value derived from the innermost relevant fetchhint property is used. The default value is the documentfetchhint property.

Fetch Type Description
prefetch Indicates a file may be downloaded when the page is loaded.
safe Indicates a file that should only be downloaded when actually needed.

fetchtimeout

The interval to wait for the content to be returned before throwing an error.badfetch event. The value is a Time Designation. The default value is the fetchtimeout property.

maxage

Indicates that the document is willing to use content whose age is no greater than the specified time in seconds. The document is not willing to use stale content, unless maxstale is also provided. If not specified, a value derived from the innermost relevant maxage property, if present, is used. The default value is the documentmaxage property.

maxstale

Indicates that the document is willing to use content that has exceeded its expiration time. If maxstale is assigned a value, then the document is willing to accept content that has exceeded its expiration time by no more than the specified number of seconds. If not specified, a value derived from the innermost relevant maxstale property, if present, is used. The default value is the documentmaxstale property.

message

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

An ECMAScript expression evaluating to the message string.

next

The URI to go to. This URI is a document (perhaps with an anchor to specify the starting dialog), or a dialog in the current document (just a bare anchor).

Children

<grammar>

Parents

<field>, <form>, <initial>, and <vxml>.

Variables

none

Example

The following example illustrates using a link element.

<link next="http://www.voicexml.org/books/main.vxml">
  <grammar mode="voice" version="1.0" root="root">
    <rule id="root" scope="public">
       <one-of>
         <item>books</item> 
         <item>VoiceXML books</item> 
       </one-of>
    </rule>
  </grammar>
  <grammar mode="dtmf" version="1.0" root="r2">
     <rule id="r2" scope="public"> 2 </rule>
  </grammar>
</link>

Version Information

Supported in: VoiceXML 1.0, VoiceXML 2.0, and VoiceXML 2.1.