No declaration for attribute "accept" of element <data>

Questions and answers about IVR programming for Plum DEV

Moderators: admin, support

  • Author
  • Message
Offline

vikas

  • Posts: 49
  • Joined: Wed May 13, 2015 8:46 pm

No declaration for attribute "accept" of element <data>

PostMon Apr 17, 2017 6:35 pm

Hi Plum

We are getting below error when using <data> tag. This is the first time we are trying to use <data> tag with headers.
Code is being run in our Preprod environment.

This document is not valid VoiceXML!
No declaration for attribute accept of element data in Entity, line: 9  



Code: Select all
<?xml version="1.0"?>
<!DOCTYPE vxml PUBLIC "-//The Plum Group//DTD VOICEXML 2.1//EN" "/usr/local/plumvp/vxml.dtd">
<vxml version="2.1">
  <form>
    <block>
      <script>
        var headers = {"X-Sample-Header-1":"asdf 1234", "X-Sample-Header-2":"fdsa 4321"};
      </script>
      <data name="test" src="script.php" accept="application/json" headersexpr="JSON.stringify(headers)"/>
    </block>
  </form>
</vxml>

Regards
Vikas
Offline

support

  • Posts: 3348
  • Joined: Mon Jun 02, 2003 4:47 pm
  • Location: Boston, MA

Re: No declaration for attribute "accept" of element <data>

PostTue Apr 18, 2017 11:25 am

Hi Vikas,

The code itself appears as though it should function correctly. There may be an error in our VoiceXML validator that needs to be updated. Can you tell us what phone number you have assigned the scratchpad to so that we can verify?

Regards,
Plum Support
Offline

Meena

  • Posts: 2
  • Joined: Wed Apr 19, 2017 12:47 pm

Re: No declaration for attribute "accept" of element <data>

PostWed Apr 19, 2017 1:23 pm

Hi Plum,

This is in continuation of Vikas message about <data> tag.

I have created a scratchpad and assigned it: 855-202-5604
Appreciate your help.

thanks
Meena
Offline

vikas

  • Posts: 49
  • Joined: Wed May 13, 2015 8:46 pm

Re: No declaration for attribute "accept" of element <data>

PostWed Apr 19, 2017 1:33 pm

I have created scratchpad and assigned it the no: 855-202-5604
Appreciate your help.
Offline

support

  • Posts: 3348
  • Joined: Mon Jun 02, 2003 4:47 pm
  • Location: Boston, MA

Re: No declaration for attribute "accept" of element <data>

PostWed Apr 19, 2017 2:21 pm

Hi Vikas,

Although our VoiceXML validator does incorrectly produce an error with your scratchpad, we tested your code and it seems as though there is no problem with the scratchpad itself, but with the "script.php" file that the src attribute is set as in the data tag, resulting in a syntax error when the number you provided is called. Because you are testing this VXML from a scratchpad, the relative path to script.php given in the src attribute will not render an existing PHP script. Since you also have the accept attribute set as "application/json", the data tag is expecting to receive JSON back after being called. Therefore, in order for this scratchpad to work, you will need to change the src attribute to a fully qualified URL that returns JSON. We tested your scratchpad with the following code as "script.php" and received no errors when calling in, despite the VoiceXML validator producing an error with the scratchpad.

Code: Select all
<?php
header('Content-Type: application/json');
$data = array(
'first_name'=>'John',
'last_name'=>'Smith',
);
echo json_encode($data);
?>



More information on JSON integration with the data tag can be found in our documents here: http://www.plumvoice.com/docs/dev/voice ... on_example

If you have any further questions please let us know. We will also be updating the VXML validator to account for this type of situation, so it will not return a false error.

Regards,
Plum Suppport
Offline

support

  • Posts: 3348
  • Joined: Mon Jun 02, 2003 4:47 pm
  • Location: Boston, MA

Re: No declaration for attribute "accept" of element <data>

PostWed Apr 19, 2017 2:57 pm

Hi Vikas,

The update to the VXML validator has been completed. We tested your scratchpad and it is no longer indicating an error.

Please let us know if you encounter any other issues.

Regards,
Plum Support

Return to Plum DEV Q&A

Who is online

Users browsing this forum: No registered users and 1 guest

cron