xsl-list
[Top] [All Lists]

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

2006-03-21 16:27:58


]The problem isn't the validity of the XML, but the validity of the
JavaScript embedded within it.

That isn't a problem if the page is handled by an XHTML system as it
will resolve all the XMl syntax before passing to javascript, so the
script element can contain <![CDATA or &lt; etc and javascript never
sees any of it. The only problem is if you generate xhtml but send it
to an html system such as IE or if you send it with an html mime type
to a system such as firefox that can handle both xhtml and html.

Is there any reason why you need to generate xhtml rather than html?
If you used xsl:output method="html"  the script element would be output
as an html CDATA element and < would be output as < rather than &lt;
so javascript would not be confused.
If you generate XHTML pages you should use an xhtml mime type (eg
application/html+xml) and only serve it to systems that understand xhtml
(which rules out IE).


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>