3.27. log

Element typelog (2.0)
Attributesexpr | label
Parentsblock | catch | error | filled | help | if | noinput | nomatch
ChildrenPCDATA | value
DescriptionWhen the interpreter encounters this element, it will write a message to its log. The message will consist either of the contents of this element or of the evaluation of the expr attribute. Developers can use log to trace the execution of their VoiceXML programs.

DTD

<!ELEMENT log (#PCDATA | value)* >
<!ATTLIST log
  label CDATA        #IMPLIED
  expr  %expression; #IMPLIED >

Language model



Attributes

expr : expression

An optional ECMAScript expression evaluating to string whose value is to be written to the log file.

label : CDATA

Indicates the category for this log message. This is useful when sifting through lengthy log files.

Children

PCDATA or value elements

To be written to the log file.

Examples

Example 3-31. Application that produces logging data
<?xml version="1.0" encoding="iso-8859-1"?>
<vxml version="2.0">
  <form id="test">
    <field name="ssno" type="digits">
      <prompt> 
        Please enter your social security number.
      </prompt>
      <filled>
        <if cond="ssno.length!=9">
          <prompt>
            I'm sorry. That is not a valid social security number.
          </prompt>
          <log label="user_error">
            Bad SS#: <value expr="ssno"/>
          </log>
          <clear namelist="ssno"/>
          <reprompt/>
        </if>
      </filled>
    </field>
  </form>
</vxml>

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.224.59.50