VoiceXML 2.1 Development GuideHome  |  Frameset Home


<clear>  element

The clear element is used to set any existing VoiceXML variable or element guard variables to an undefined value, such as any user-defined variable set with the var or assign tags. The clear element can also be used to clear any block, subdialog, menu, record, transfer, or field guard variables, thus, programmatically allowing a caller to revisit these form items.


usage
<clear namelist="NMTOKEN">


attributes
namelistData Type: NMTOKENDefault: Optional
The ‘namelist’ attribute allows you to specify particular variables or guard variables to be cleared upon execution. If none are explicitly set within this attribute, then all form items in the current form are cleared by default.



shadow variables
none


parents
<block> <catch> <error> <filled> <help> <if> <noinput> <nomatch>


children
none


code samples
<Clear namelist> 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">

  <field name="F_1">
    <prompt>
      which affliction plagued George W Bush as a child. was it chronic
      bedwetting, or cooties?
    </prompt>

    <grammar type="text/gsl">[(?chronic bedwetting) cooties]</grammar>

    <filled>
      <prompt>
        our variables value is <value expr="F_1"/>.
      </prompt>
    </filled>
  </field>

  <block>
    <clear namelist="F_1"/>
    <prompt>
      but, after clearing it, it is <value expr="F_1"/>
    </prompt>
    <disconnect/>
  </block>

</form>

</vxml>



additional links
W3C 2.0 Specification


  ANNOTATIONS: EXISTING POSTS
medicaone
3/18/2004 12:42 AM (EST)
Not researched but observed: It appears that <clear/> placed in a <catch/> block in the 2.0 Motorola browser causes an 'internal error in the gateway software". The same construct worked in the 1.3 Nuance browser.

Example:
<catch event="com.xyzcorp.voice.help">
<clear/>
<prompt>
help text goes here
</prompt>
<reprompt/>
</catch>
willigar
1/5/2007 2:41 PM (EST)
I'm seconding what medicaone observed, namely that you can't add <clear> to a catch block. In my case, the <clear> had no namelist specified and was at the document level. When I moved it to the form level, all worked fine (although that doesn't solve my problem). I haven't investigated whether it would work at doc level with a namelist specified.
MattHenry
1/5/2007 5:58 PM (EST)


Greetings gents,

I have verified this behavior as well,and have opened up bug ticket [b]#207734[/b] to track this issue to resolution. When we have deployed a fix for this, I'll be sure to post back to you so that you can make sure the problem no longer manifests itself.

I did verify that specifying a 'namelist' attribute allows you to effectively work around this behavior, however, (see attached).

Regards,

~Matthew Henry

login



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