<?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">



 <catch>
  <conf:fail expr="'document caught event ' + _event"/>
 </catch>


 <form id="phormOne">

  <error>
    <conf:comment>
      Caught first <value expr="_event"/> event correctly, going on to second form
    </conf:comment>
    <goto next="#phormTwo"/>
  </error>

  <catch event="error">
    <conf:comment>
      Caught first <value expr="_event"/> event with the wrong handler, failure
    </conf:comment>
    <conf:fail reason="Caught first event with second handler"/>
  </catch>

  <block>
    <conf:comment>
      Throwing event..
    </conf:comment>

    <throw event="error"/>

    <conf:comment>
      Executing block after throw in first form, bad..
    </conf:comment>
    <conf:fail reason="Executing block after throw in first form"/>
  </block>

 </form>


 <form id="phormTwo">

  <catch event="error">
    <conf:comment>
      Caught <value expr="_event"/> in the first handler, second form, good
    </conf:comment>
    <conf:pass/>
  </catch>

  <error>
    <conf:comment>
      Caught <value expr="_event"/> in the second handler, second form, bad
    </conf:comment>
    <conf:fail reason="Caught second handler, second form"/>
  </error>

  <block>
    <conf:comment>
      Throwing second event..
    </conf:comment>

    <throw event="error"/>
  </block>

  <block>
    <conf:comment>
      Didn't execute any event handlers in second form
    </conf:comment>
    <conf:fail reason="Didn't execute anything in second form"/>
  </block>

 </form>
</vxml>
