CCXML 1.0 Development Guide Home  |  Frameset Home


<goto>  element

The <goto> element, used in conjunction with the <fetch> element, is used to transfer execution to a separate CCXML document. The <fetch> element allows for a pre-emptive fetch and parse of the target document to ensure that it is well formed and can execute before the <goto> ever executes. Execution returns from this element immediately, and the CCXML interpreter is free to continue while the execution context parses and prepares the target document for execution. If the target is fetchable, and parseable, an event 'ccxml.fetch.done' is sent, and the <goto> may now execute normally. However, if there is a problem with the target page, the event of 'error.fetch' is thrown to the invoking document.



usage
<goto fetchid="(ECMAScript Expression)">


attributes
fetchid Data Type: (ECMAScript Expression) Default: none - attribute is required
This attribute indicates the ID of any document referenced in a fetch operation, which is gathered with the fetchid. A sucessful fetch completion additionally provides a property whose value is the fetch ID of the document being fetched.



parents
none


children
none


code samples
<1.0 goto -fetchid> sample
<?xml version="1.0" encoding="UTF-8"?>
<ccxml version="1.0" xmlns="http://www.w3.org/2002/09/ccxml">

<eventprocessor>

  <transition event="connection.alerting" name="evt">
  <accept/>
  <log expr="'*** CALL ACCEPTED ***'"/>
  </transition>

  <transition event="connection.connected" name="evt">
  <log expr="'*** CALL CONNECTED, STARTING FETCH ***'"/>
  <fetch next="'docToFetch.xml'" fetchid="'myFetchID'"/>
  </transition>

  <transition event="fetch.done" name="evt">
  <goto fetchid="evt.fetchid"/>
  </transition>

  <transition event="error.fetch" name="evt">
  <log expr="'*** AN ERROR OCCURRED DURING THE FETCH ***'"/>
  </transition>

  <transition event="error.*" name="evt">
  <log expr="'ERROR OCCURRED: '+ evt.name"/>
  <exit/>
  </transition>

</eventprocessor>
</ccxml>

<docToFetch.xml>
<?xml version="1.0" encoding="UTF-8"?>
<ccxml version="1.0" xmlns="http://www.w3.org/2002/09/ccxml">

<eventprocessor>

  <transition event="ccxml.loaded">
  <log expr="'*** OUR NEW CCXML DOCUMENT HAS BEEN FETCHED! ***'"/>
  <exit/>
  </transition>

  <transition event="error.*" name="evt">
  <log expr="'ERROR OCCURRED: '+ evt.name"/>
  <exit/>
  </transition>
         
  </eventprocessor>

</ccxml>



additional links
W3C Specification


  ANNOTATIONS: EXISTING POSTS
0 posts - click the button below to add a note to this page

login



© 2006 Voxeo Corporation  |  Voxeo IVR  |  VoiceXML & CCXML IVR Developer Site