xsl-list
[Top] [All Lists]

Re: [xsl] Re: Un-cdata-section-elements

2006-03-22 03:06:27

Again, the problem isn't the validity of the markup, but the
JavaScript as interpreted by various browsers; some processors
(possibly all?) will throw a CDATA around anything in the <script>
element by default, mostly because the chance of bumping into
non-valid stuff is high.

No. HTML processors interpret the content of a script as CDATA as HTML's
script element is defined to be of type CDATA. CDTATA elements do not
exist in XML so in XHTML script is a normal element (with PCDATA
content). Your problem is just caused by sending a page marked up in one
language (XHTML) to a browser written to interpret another (HTML).
It's like sending Java to a C compiler: you get syntax errors.

The '// CDATA' best-practice rule is of course inclusive of all
browsers, new and old, and I would have liked to play it that way. Oh
well.

You can use disable-output-escaping to get that from XSLT, if you must.

<xsl:text disable-output-escaping="yes"><![CDATA[
//<![CDATA[
  ..... stuff here ...
//]]>]]&gt;
</xsl:text>


David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

--~------------------------------------------------------------------
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>
--~--

<Prev in Thread] Current Thread [Next in Thread>