We've Moved! Please visit our new and improved forum over at our new portal: https://portal.plumvoice.com/hc/en-us/community/topics

<voice> tag w/i <choice> issue

Questions and answers about IVR programming for Plum DEV

Moderators: admin, support

Post Reply
tloring
Posts: 22
Joined: Sun Sep 07, 2003 3:51 pm

<voice> tag w/i <choice> issue

Post by tloring »

The <voice> tag w/i a choice tag is generating an bad fetch error. The validator does in fact give an error, however, <voice> should be a valid child tag of <choice> (per plum online reference and other sources). Or am I missing something? Thanks.

Code: Select all

Validation Results: 
Error at  line 12, char 79
  Message: Element 'voice' is not valid for content model: '(#PCDATA|grammar)*'

Code: Select all

<?xml version='1.0'?>
<vxml version="2.0" application="global.xml">

<menu id="mainmenu">
  <prompt>
  <voice name="audrey">
  Press 1 to record.
  Press 2 for help.
  Press 3 to end call.
  </voice>
  </prompt>
  <choice dtmf="1" next="#record"><voice name="audrey">Record</voice></choice>
  <choice dtmf="2" next="#help">Help</choice>                 
  <choice dtmf="3" next="#end">End Call</choice>              
</menu>                 

</vxml>
[/code]

support
Posts: 3632
Joined: Mon Jun 02, 2003 3:47 pm
Location: Boston, MA
Contact:

IVR Programmer's Guide

Post by support »

Hi Tom:

Looks like you've uncovered a mistake in the IVR Programmers guide! Shame on you! :)

jk, thanks for alerting us...according to the w3c official VXML DTD, only IVR grammars are allowed within choice tags.


kind regards,

Plum Support
Last edited by support on Thu Feb 25, 2010 4:31 pm, edited 2 times in total.

support
Posts: 3632
Joined: Mon Jun 02, 2003 3:47 pm
Location: Boston, MA
Contact:

IVR Programmers Reference manual (PRM) updated

Post by support »

We've updated the IVR PRM to reflect this change. Thanks for the heads up, Tom!


Plum Support
Last edited by support on Fri Jan 15, 2010 4:10 pm, edited 2 times in total.

tloring
Posts: 22
Joined: Sun Sep 07, 2003 3:51 pm

Post by tloring »

That's what I get for RTFM...should have just looked at the spec :)

Hmm...yes, you're right...then I've also uncovered a mistake in "Definitive VoiceXML" (Adam Hocek, David Cuddihy), which lists <voice> as a child as well in the tag summary.

I realize now I didn't really need it there - I was thrown off by the documentation. If I want to use the <choice> contents for the prompt, I just need to <enumerate> them w/i the <prompt> in which I can set the <voice> legally.

Code: Select all

<menu id="mainmenu">
  <prompt>
  <voice name="audrey">
  <enumerate>Press <value expr="_dtmf"/> to <value expr="_prompt"/><break size="small"/></enumerate>
  </voice>
  </prompt>
  <choice dtmf="1" next="#record">Record</choice>
  <choice dtmf="2" next="#help">Help</choice>
  <choice dtmf="3" next="#end">End Call</choice>
</menu>
So, all is good.

Post Reply