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

CDATA in script validates, but fails at runtime

Questions and answers about IVR programming for Plum DEV

Moderators: admin, support

Post Reply
moshe
Posts: 66
Joined: Wed Aug 15, 2007 5:36 pm
Location: Chicago
Contact:

CDATA in script validates, but fails at runtime

Post by moshe »

Here's a code snippet:

Code: Select all

<script>
	<![CDATA[
	// instantiate these
	for (  var c = 0 ;  c < requestTypes.length ; c++ ) {
		
		s = requestTypes[c] + "=\"" + requestTypes[c] + "\""
		eval ( s ) 
	}
	]]>
</script>
When I validate the file with this snippet, I find no problems (unless I forget to put in the CDATA).

When I attept to run this code, I get an error of "expected an element name". It's attempting to interpret the

Code: Select all

<
as the start of an element name, or it's expecting a

Code: Select all

<
regardless of the CDATA declaration.

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

IVR script needed to understand user's issue

Post by support »

Hi,

We are not able to replicate this IVR issue. Could you provide us with a short, but complete VoiceXML script that demonstrates this IVR behavior?

Regards,
Plum Support
Last edited by support on Fri Feb 19, 2010 4:35 pm, edited 2 times in total.

moshe
Posts: 66
Joined: Wed Aug 15, 2007 5:36 pm
Location: Chicago
Contact:

Hmm.... now it does work

Post by moshe »

I created this script to test this out, but now I can't get it to fail. The actual JS is inside this root document. The root document is essentially the exact same one that failed before.

I now begin to suspect that it was a caching issue, and that a version without CDATA was indefinitely cached and I was hitting the same old copy each time. Now that the cache has cleared the CDATA version is being picked up and all is well.

If it's likely to have been a caching issue, let's put all this aside for another time.

Post Reply