<link>

Specifies one or more grammars, which are scoped to the element containing the link.

Syntax

<link
    dtmf = "CDATA"
    event = "CDATA"
    eventexpr = "CDATA"
    expr = "CDATA"
    fetchaudio = "URI"
    fetchint = "{prefetch | safe}"
    fetchtimeout = "CDATA"
   next = "URI"
    scope = "{document | dialog}"
    src = "URI"
    tag-format = "CDATA"
    type = "CDATA"
    version = "CDATA"
    weight = "CDATA"
    xml:lang = "locale identifier"
    xmlns = "CDATA"
    xmlns:xsi = "CDATA"
    xsi:schemalocation = "CDATA"
/>

Attributes

None of the attributes are required.

Attribute

Data Type

Required?

Default

Description

dtmf

CDATA

no

NA

DTMF key used to validate a successful grammar match.

event

CDATA

no

NA

Event that can be raised to the application.

eventexpr

CDATA

no

NA

ECMAScript expression that evaluates to the event which can be raised to the application.

expr

CDATA

no

NA

ECMAScript value that evaluates to the target URI.

fetchaudio

{voice | dtmf}

no

NA

URI of an audio resource to play while the XML data is fetched. If the fetchaudio attribute is not set, no audio is played during the fetch. If the audio is playing after the XML document is fetched, the audio terminates.

fetchhint

{prefetch | safe}

no

NA

Specifies when the VoiceXML Interpreter context should retrieve content from the server. Valid values:

  • prefetch = Fetch the resource when the page is loaded.

  • safe = Fetch the resource when it is specifically called by the application.

fetchtimeout

CDATA

no

NA

Time interval to wait for the content to be returned before throwing an error.badfetch event. Use s for seconds (for example, 1s) and ms for milliseconds (for example, 1ms).

next

URI

no

NA

URI of the dialog (form or menu) or document to transition to when the user input matches one of the grammars specified by <link>.

scope

{dialog | document}

no

dialog

Scope for the grammar contained in the form. Valid values:

  • dialog = Grammar is active only in the current form.

  • document = Grammar is active throughout the current document.

src

URI

no

NA

URI of the grammar file.

tag-format

CDATA

no

Nuance

Tag format of the grammar. Currently the only supported format is of type "Nuance".

type

CDATA

no

NA

MIME type of the grammar. If omitted, the VoiceXML Interpreter attempts to determine the type dynamically. The type attribute can also specify the character encoding of the grammar, as follows:

type="application/srgs+xml; charset=UTF-8"

version

CDATA

no

NA

SRGS version of this grammar. Currently not supported.

weight

CDATA

no

NA

Currently not supported.

xml:lang

locale identifier

no

NA

Language and locale of the document using an identifier compliant with RFC 1766.

xmlns

CDATA

no

NA

(Applies to stand-alone SRGS XML documents only.) Designated namespace for the SRGS XML format.

xml:xsi

CDATA

no

NA

(Applies to stand-alone SRGS XML documents only.) Used with xsi:schemalocation to indicate the location of the schema for the SRGS XML namespace.

xmlschemalocation

CDATA

no

NA

(Applies to stand-alone SRGS XML documents only.) Used with xmlns:xsi to indicate the location of the schema for the SRGS XML namespace.

Details

When one of the grammars specified by <link> is matched, the link is activated and does one of the following:

Parents

<field>, <form>, <initial>, <vxml>

Children

<grammar>

Example

<?xml version="1.0"?>
<!DOCTYPE vxml PUBLIC '-//Vision/DTD VoiceXML 2.1//EN' 
    'http://dtd.vision.com/voice/2.1/vision_voicexml-2.1.dtd'>
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml">
    <link next="#linkTest">
        <grammar type="application/srgs+xml" root="Repeat">
            <rule id="Repeat">
                <item>repeat</item>
            </rule>
        </grammar>
    </link>
    <catch event="quit">
        Goodbye
        <exit/>
    </catch>
    <form id="init">
        <field name="link" >
            <prompt>
                Say repeat to execute the link
                    <break time="90ms"/>
                Or say quit to exit 
                    <break time="200ms"/>
            </prompt>
            <link event="quit">
             
             <grammar type="application/srgs+xml" root="Quit">
                 <rule id="Quit">
                     <item>quit</item>
                 </rule>
             </grammar>
             
            </link>
        </field>
        <catch event="noinput nomatch">
            <reprompt/>
        </catch>
    </form>
    <form id="linkTest">
        <block>
            This is the link test
            <goto next="#init"/>
        </block>
    </form>
</vxml>

See Also

<form>