xsl-list
[Top] [All Lists]

Re: [xsl] Preventing CDATA output in XHTML

2007-07-02 15:33:51
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).


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--