Re: [xsl] Preventing CDATA output in XHTML

Subject: Re: [xsl] Preventing CDATA output in XHTML
From: Abel Braaksma <abel.online@xxxxxxxxx>
Date: Tue, 03 Jul 2007 00:30:44 +0200
Manfred Staudinger wrote:
Hi Brian,

Here's the output:

<script type="text/javascript">
<![CDATA[
      some_func("some_arg");
    ]]>
</script>

which FF refuses to parse without errors.

I have taken those few lines and put them somewhere in a xhtml, but it does _not_ produce any error with Fx 2.0.0.4 (I also verified the source from the browsers view).


I second that. Also, the CDATA problem is an IE problem, not a FF problem. To circumvent it, you can use:


<script...>
// <![CDATA[
....your script....
// ]]>
</script>

if I am not mistaken...

And you do not need CDATA if your script sections do not contain < or & characters (but that may be well known though).

Current Thread