[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] Preventing CDATA output in XHTML


Subject: Re: [xsl] Preventing CDATA output in XHTML
From: "Manfred Staudinger" <manfred.staudinger@xxxxxxxxx>
Date: Tue, 3 Jul 2007 00:15:12 +0200

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).

Manfred

On 02/07/07, Brian Koontz <briank@xxxxxxxxxxxxxxxxxxx> wrote:
Environment:

DOM/XML API Version 	20020815
libxml Version 	20616
libxslt Version 	1.1.11
libxslt compiled against libxml Version 	2.6.16
libexslt Version 	1.1.11
PHP 4.3.6

I'm trying to prevent CDATA tags from being generated in my XHTML output.
Here's what's in the XSL:

    <script type="text/javascript">
      some_func("some_arg")
    </script>

Here's the output:

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

which FF refuses to parse without errors.

I've poured through the FAQs and have tried everything suggested:
Wrapping in <xsl:text>, wrapping in an HTML comment, using the
disable-output-escaping=yes attribute on <xsl:text>, etc.

XSL such as this:

<script type="text/javascript" src="js/somefile.js"></script>

is rendered without CDATA tags.

I've run out of ideas...about the only idea remaining is to switch XSLT
libs to see if that resolves the problem. Suggestions?

--Brian


Current Thread
Keywords