[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Un-cdata-section-elements

Subject: Re: Un-cdata-section-elements
From: David Carlisle <davidc@xxxxxxxxx>
Date: Tue, 21 Mar 2006 13:39:59 GMT
xhtml cdata
> Is there any way to undo the CDATA section rules for outputting XHTML
> 1.0? I'm trying to create something like ;

In theory you should never need to do this.
If you are outputting HTML then the javascript wil be output by XSLT
using CDATA conventions as script is a CDATA element in HTML.

If you are outputting XHTML then script is a normal element (as CDATA
elements do not exist in XML) an any conforming XHTML engine will
correctly interpret any &lt; and &amp; as XML markup and decode them
_before_ passing the resulting string to the javascript engine.

This theory though assumes that people only give html to html systems
and xhtml to xhtml systems, however unfortunately it seems to be
increasngly common to give xhtml to html systems, which leads to these
problems.

In XSLT1 you'd probably have to use disable-output-escaping. to generate
  // <![CDATA[
in XSLT2 it would be better to use a character map, pick a couple of
unused characters, and declare a character map so that one is serialised
as   // <![CDATA[ and the other as //]]> and just arrange to put these
characters as the first and last characters in the script element
content. Similarly use a couple of characters representing an unescaped
  < and &.

> but the JavaScript
> engines complain (it doesn't understand CDATA, of course)
If the page is handled by a conforming XHTML system all aspects of the
XML markup will be resolved before javascript sees the file.

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
________________________________________________________________________

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.