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

Subject: Re: [xsl] Re: Un-cdata-section-elements
From: "Alexander Johannesen" <alexander.johannesen@xxxxxxxxx>
Date: Wed, 22 Mar 2006 22:39:38 +1100
On 3/22/06, David Carlisle <davidc@xxxxxxxxx> wrote:
> 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.

Well, not quite as the wanted output is perfectly valid syntax. It may
be dirty XML, but it certainly is valid. :) And also not quite in
regards that some of these browsers *do* know XHTML; the '//' part is
there for the browsers that only know HTML. There is no syntax error
here, but I'll admit it doesn't feel clean and neat.

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

Manually I can do pretty much anything I like, that's not the problem.
The problem is the use of <xsl:template match="script"> and how XSLT
processors treat it; the output node tree will be converted from its
native form to whatever output you specify, and if that's XHTML 1.0
Strict than the processors I'm using fill in the automatic CDATA
section of <script> elements in the node tree.

It's not so much that I can't live without this "best-practice", but
it would be preferrable to have it, in the name of keeping things as
valid and backwards compatible as possible at the same time.

"Ultimately, all things are known because you want to believe you know."
                                                         - Frank Herbert
__ __________________________________________________

Current Thread