Page 1 of 1

<voice> tag w/i <choice> issue

Posted: Wed Jul 28, 2004 11:19 am
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]

IVR Programmer's Guide

Posted: Wed Jul 28, 2004 2:41 pm
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

IVR Programmers Reference manual (PRM) updated

Posted: Wed Jul 28, 2004 3:07 pm
by support
We've updated the IVR PRM to reflect this change. Thanks for the heads up, Tom!


Plum Support

Posted: Thu Jul 29, 2004 8:50 am
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.