Home > Articles > Web Services > XML

  • Print
  • + Share This
This chapter is from the book

This chapter is from the book

3.19 goto

Element type

goto

Attributes

expr | expritem | fetchaudio | fetchhint | fetchtimeout | maxage (2.0) | maxstale (2.0) | next | nextitem

Parents

block | catch | error | filled | help | if | noinput | nomatch

Children

None.

Description

Used to pass control to another form.item within the same dialog, to another dialog within the same document, or to a dialog in a different document.

DTD

<!ELEMENT goto EMPTY >
<!ATTLIST goto
  %cache.attrs;
  %next.attrs;
  fetchaudio    %uri;        #IMPLIED
  expritem      %expression; #IMPLIED
  nextitem      %field.name; #IMPLIED >

Language model

03fig19.gif

Attributes

  • expr : expression

    An ECMAScript expression that yields the destination URI.

  • expritem : expression

    An ECMAScript expression that yields the name of the next form item.

  • fetchaudio : uri

    The URI of the audio to play while fetching a document.

  • fetchhint : (prefetch | safe)

    Indicates whether the interpreter may prefetch the destination document specified by this element's next attribute. A value of prefetch indicates the resource may be retrieved at the time the containing VoiceXML document is retrieved. A value of safe indicates that the resource specified by this element should not be prefetched, but should instead be retrieved at the time that the interpreter executes this element.

  • fetchtimeout : duration

    The interval to wait for the content to be returned before throwing an error.badfetch event. If this attribute is not specified, the interpreter derives a value from scoped-locally-scoped fetchtimeout property.

  • maxage : integer

    Indicates the maximum allowable age of the fetched document in seconds. If the cached copy is older than the specified maxage, a new copy will be fetched when the interpreter executes this element. If this attribute is not specified, the interpreter derives a value from the most locally scoped maxage property. If no maxstale attribute is defined and it is impossible to fetch a new copy on the content the interpreter will throw an error.badfetch instead of using stale content.

  • maxstale : integer

    Indicates that the interpreter may use stale content for this element as long as its age is no older than maxage plus the value of maxstale in seconds. If this attribute is not specified, the interpreter derives a value from the most locally scoped maxstale property.

  • next : uri

    The destination URI.

  • nextitem : field.name

    The name of the next form item to visit.

Children

None.

Examples

Example 3-21 Various uses of the goto element

<?xml version="1.0" encoding="iso-8859-1"?>
<vxml version="1.0">
  <form id="test">
    <block name="block1">
      <prompt>This is block one.</prompt>
      <goto nextitem="block3"/>
    </block>
    <block name="block2">
      <prompt>This is block two.</prompt>
      <goto next="#exit"/>
    </block>
    <block name="block3">
      <prompt>This is block three.</prompt>
    </block>
  </form>

  <form id="exit">
    <block>
      <prompt>Now exiting</prompt>
    </block>
  </form>
</vxml>
  • + Share This
  • 🔖 Save To Your Account