<?xml version="1.0"?>
<!-- @ Copyright 1998-2003 W3C (MIT, ERCIM, Keio), All Rights Reserved. See http://www.w3.org/Consortium/Legal/. @ -->
<vxml version="2.0" xmlns="http://www.w3.org/2001/vxml"
      xmlns:conf="http://www.w3.org/2002/vxml-conformance">

<!--
    1071: When a form is entered, the prompt counter is initialised
    to 1 for every input item. Thus the prompt with count=1 will
    always be played first for all input items.
-->

  <catch>
    <conf:comment>
      Toplevel caught event <value expr="_event"/>
    </conf:comment>
    <conf:fail expr="_event"/>
  </catch>

  <var name="prompt" expr="'oops'"/>

  <form id="first">
    <noinput>
        <reprompt/>
    </noinput>

    <field name="f1" cond="true">
      <conf:speech value="alpha"/>
      <conf:grammar utterance="alpha"/>
      <prompt count="1"> <value expr="prompt = ' '"/> </prompt>
      <filled>
        <if cond="prompt == 'oops'">
          <conf:fail reason="In field one the prompt was not played."/>
        </if>
        <assign name="prompt" expr="'oops'"/>
      </filled>
    </field>

    <record name="r" cond="true">
      <conf:speech value="bravo"/>
      <prompt count="1"> <value expr="prompt = ' '"/> </prompt>
      <filled>
        <if cond="prompt == 'oops'">
          <conf:fail reason="In record the prompt was not played."/>
        </if>
        <assign name="prompt" expr="'oops'"/>
      </filled>
    </record>

    <subdialog name="s" cond="true" src="#prompt">
      <prompt count="1"> <value expr="prompt = ' '"/> </prompt>
      <filled>
        <if cond="prompt == 'oops'">
          <conf:fail reason="In subdialog the prompt was not played."/>
        </if>
        <assign name="prompt" expr="'oops'"/>
      </filled>
    </subdialog>

    <transfer name="t" cond="true" dest="anunsupporteduri:+xxx-xxx-xxxxxxx">
      <prompt count="1"> <value expr="prompt = ' '"/> </prompt>
      <filled>
        <if cond="prompt == 'oops'">
          <conf:fail reason="In transfer the prompt was not played."/>
        </if>
        <assign name="prompt" expr="'oops'"/>
      </filled>
      <!-- Assume platform doesn't handle <transfer> (or fails on our odd URI). -->
      <error>
        <conf:comment> Caught event <value expr="_event"/> in transfer element. </conf:comment>
        <assign name="t" expr="1234"/>
        <reprompt/>
      </error>
    </transfer>


    <!-- Assume platform doesn't handle <object> (or our odd object). -->
    <object name="o" cond="true" classid="awierduri://astupidobjectname">
      <prompt count="1"> <value expr="prompt = ' '"/> </prompt>
      <error>
        <conf:comment> Caught event <value expr="_event"/> in object element. </conf:comment>
        <assign name="o" expr="1234"/>
        <assign name="prompt" expr="' '"/>  <!-- Assume prompt may not be played if object in error. -->
        <goto next="#pass"/>  <!-- Avoids an event loop on one platform. -->
      </error> 
    </object>

    <block>
      <conf:fail reason="Should not have gotten here."/>
    </block>
  </form>


  <form id="pass">
    <block>
      <if cond="prompt != ' '">
        <conf:fail reason="In object the prompt was not played."/>
      </if>
      <conf:pass/>
    </block>
  </form>


  <form id="prompt">
    <var name="a" expr="'AAA'"/>
    <block>
      <return namelist="a"/>
    </block>
  </form>

</vxml>
