Thilina Sampath
Thilina Sampath

Reputation: 3775

How check vxml has error?

<?xml version="1.0" encoding="iso-8859-1" standalone="no"?>
<!-- DOCTYPE vxml SYSTEM "http://127.0.0.1:5000/voicexml1-0.dtd" -->
<vxml xmlns="http://www.w3.org/2001/vxml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.0">

  <form id="dtmfForm">
      <property name="inputmodes" value="dtmf"/>
      <field name="dtmf">
        <audio src="http://localhost/File/voicefiles/T/menu/playCatDefinition.wav"/>

    <prompt>press 1</prompt>
        <audio src="http://localhost/File/voicefiles/T/cats/Love.wav"/>

    <prompt>press 2</prompt>
        <audio src="http://localhost/File/voicefiles/T/cats/Thinking of you.wav"/>

    <prompt>press 3</prompt>
        <audio src="http://localhost/File/voicefiles/T/cats/Oba Nathi Da.wav"/>

    <prompt>press 4</prompt>
        <audio src="http://localhost/File/voicefiles/T/cats/Adareta Kiyana Katha.wav"/>

    <prompt>press 5</prompt>
        <audio src="http://localhost/File/voicefiles/T/cats/Akamatththa.wav"/>

    <prompt>press 6</prompt>
        <audio src="http://localhost/File/voicefiles/T/cats/Sorry.wav"/>

    <prompt>press 7</prompt>
        <audio src="http://localhost/File/voicefiles/T/cats/Birthday.wav"/>

    <prompt>press 8</prompt>
        <audio src="http://localhost/File/voicefiles/T/cats/Annivesary.wav"/>

    <prompt>
        go to next step press 0 
    </prompt>

        <grammar mode="dtmf" root="digit">
          <rule id="digit" scope="public"> 
            <one-of>
                <item>0</item>
                <item>1</item>
                <item>2</item>
                <item>3</item>
                <item>4</item>
                <item>5</item>
                <item>6</item>
                <item>7</item>
                <item>8</item>
                <item>9</item>
            </one-of>
          </rule>
        </grammar>

    <if cond="dtmf=='9'">
        <goto next="http://localhost/myApp/resteasy/service/msisdn/7777?greetingCatagory='dtmf'"/>
    <else />
        <goto next="http://localhost/myApp/resteasy/service/msisdn/7777?greeting='dtmf'"/>
    </if>
      </field>      
    </form>
    <nomatch>
        No Match! I'm sorry, I didn't understand you.  Could you please try that again? 
        <reprompt />
    </nomatch>
    <noinput>
        No Input! I'm sorry, I didn't hear anything.  Could you please try that again? 
        <reprompt />
    </noinput>
</vxml>

Consider this vxml any error in this how to check vxml have error. How to, I Solve it? what kind error include in this vxml some time go to <goto next={url}/> this step other code not working .what is the error in this code? how to mange time next step go to.. I am looking for suitable answer?

Thanks.

Upvotes: 0

Views: 1427

Answers (4)

Shashikiran
Shashikiran

Reputation: 11

Whether you are using scripting language or static vxml, you must run the page in browser to see what xml output you get. It will tell you if any ecmascript/xml errors. Even if xml output is correct, then you have to check all tags carefully.

Sometimes vxml servers won't give you proper error information.

Upvotes: 0

Borja SIXTO
Borja SIXTO

Reputation: 119

Voximal integrates a command line tool called vxmlvalidator.

If you install the Voximal package you can use it to validate VoiceXML 2.0 and 2.1 standard documents.

root@192:~# vxmlvalidator http://demo.ulex.fr/vxml/index.vxml
------------------------------------------------------------------------------
.

VALID: http://demo.ulex.fr/vxml/index.vxml

TIME PROCESSING: 213697

PAGES PARSED: 1 (4.67952 p/s)

Upvotes: 0

Alberto Navatta
Alberto Navatta

Reputation: 131

VoiceXML document validation can be done against VoiceXML DTD, in the code you posted <goto> and also <if> elements are what in VoiceXML is called executable content, executable content can be contained only in the following elements:

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

So in your page the <if> element is inside the wrong element.

Online (Voice)XML validation can be done using the validator on the W3C site, direct validation of your document against W3C validator would give the following error:

Line 57, Column 25: document type does not allow element "if" here; missing one of "catch", "help", "noinput", "nomatch", "error", "filled" start-tag

In order to have a correct DTD validation you need to add a valid DOCTYPE at the beginning of the VoiceXML document, e.g. VoiceXML 2.1 DOCTYPE is the following:

<!DOCTYPE vxml PUBLIC "-//W3C//DTD VOICEXML 2.1//EN" "http://www.w3.org/TR/voicexml21/vxml.dtd">.

Upvotes: 0

lich
lich

Reputation: 290

<goto> element can't be inside <field>, that is responsible for collecting information from the user. It should be moved to <filled> responsible for it's interpretation. Structure is the following:

<form>
  <field>
    <grammar>...</grammar>
  </field>
  <filled>
     <goto ...
  </filled>
</form>

Voxeo documentation - filled element

Upvotes: 3

Related Questions