VoiceXML 2.1 Development GuideHome  |  Frameset Home


<initial>  element

The initial element is used in  mixed-initiative dialogs, (where the caller’s first utterances dictate application flow), allowing the caller to fill in form-wide information, (thus allowing the user to skip over the field prompts), with but one utterance. Usually, the first prompt in a mixed initiative dialog will query the caller for all information, and then only execute the fields when it determines that all field variables have not been filled. The initial element does not contain any grammars or filled events of its own; rather, it relies on the grammars and filled elements of each individual field.


usage
<initial cond="CDATA" expr="CDATA" name="NMTOKEN">


attributes
condData Type: CDATADefault: Optional (true)
The cond attribute specifies a Boolean expression, which must equate to ‘true’ in order for the content to be visited and executed. (Additionally, the expr attribute must also be set to ‘undefined’, see below).
exprData Type: CDATADefault: Optional
The expr attribute specifies the initial value of  the element; if this value is ‘undefined’, (default), then the element will be visited by the FIA and executed. If  this attribute has a  value other than ‘undefined’, then the element will not be visited until explicitly set to 'undefined', by use of the clear element.
nameData Type: NMTOKENDefault: Optional
The name attribute specifies the name of the ECMAScript form item variable. Each name assigned to an Initial element must be unique, else a fatal error.badfetch will be thrown.



shadow variables
none


parents
<form>


children
<audio> <catch> <enumerate> <error> <help> <link> <noinput> <nomatch> <prompt> <property> <value>


code samples
<Initial cond-expr> sample
<?xml version="1.0" encoding="UTF-8"?>

<vxml version = "2.1">

<meta name="author" content="Matthew Henry"/>
<meta name="copyright" content="2005 voxeo corporation"/>
<meta name="maintainer" content="YOUR_EMAIL@HERE.COM"/>

<form id="F1">

  <grammar type="text/gsl">[dummy]</grammar>

  <initial name="Initial_1" expr="'SomeValue'" cond="false">
    <prompt>
      this Initial form item will be skipped, as the expression
      is not equal to undefined and the condition is set to false.
    </prompt>
  </initial>

  <block>
  <goto next="#F2"/>
  </block>
</form>

<form id="F2">
  <grammar type="text/gsl">
  <![CDATA[
[dtmf-1] {<F_1  "SomeValue">}
                  ]]>
  </grammar>

  <initial name="Initial_2" cond="true" expr="">
    <prompt>
      this inital form item will get executed, as the expression 
      is set to undefined and the condition is set to true pressing
      DTMF 1 will execute the enclosed field.
    </prompt>
 
    <nomatch count="1">
      <prompt>
        Okay, I'll ask you for information one piece at a time.
      </prompt>
      <assign name="Initial_2" expr="true"/>
      <reprompt/>
    </nomatch>     

    <noinput>
      <prompt>
        Okay, the quiet type, eh?
        I'll ask you for information one piece at a time.
      </prompt>
      <assign name="Initial_2" expr="true"/>
      <reprompt/>
      </noinput>


  </initial>

  <field name="F_1">
    <prompt> try pressing DTMF 1.</prompt>
  </field>

  <filled>
    <prompt> congratulations, the initial test was successful.</prompt>
  </filled>

</form>
</vxml>



additional links
W3C 2.0 Specification


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

login



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