Page 1 of 1

CDATA in script validates, but fails at runtime

Posted: Fri Sep 21, 2007 12:46 pm
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.

IVR script needed to understand user's issue

Posted: Fri Sep 21, 2007 2:31 pm
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

Hmm.... now it does work

Posted: Fri Sep 21, 2007 3:32 pm
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.