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

RE: CDATA Handling

Subject: RE: CDATA Handling
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Tue, 6 Jan 2009 09:41:44 -0000
RE:  CDATA Handling
CDATA is treated by XSLT as an input convenience: the XSLT processor doesn't
know that the data was entered using CDATA, any more than it knows whether
you used the SHIFT key or CAPS LOCK. It's just a shortcut for data entry,
not part of the information content of the document. This also explains why
there is very weak support for producing CDATA on output.

If your XML document design uses CDATA to convey information, then you need
to think seriously about improving the design. If the receiving application
only works if the data is enclosed in CDATA, then you need to think
seriously about improving that application. If you can't do either of those
things, then you are going to have to do some messy programming to generate
the CDATA section. One way is to use cdata-section-elements on xsl:output as
suggested already on this thread, another is to generate the CDATA start and
end strings (<![CDATA[ and ]]>) using character maps or
disable-output-escaping.

Michael Kay
http://www.saxonica.com/ 

> -----Original Message-----
> From: J. S. Rawat [mailto:jrawat@xxxxxxxxxxxxxx] 
> Sent: 06 January 2009 05:56
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx; xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  CDATA Handling
> 
> Hi,
> Can anyone help let me about the handling of CDATA by XSLT 
> 2.0 (saxon).
> 
> Input
> <img.embed><![CDATA[R0lGODlhDQANAMQ0IAOw==]]></img.embed>
> 
> Required output
> <![CDATA[R0lGODlhDQANAMQ0IAOw==]]>
> 
> Thanks
> ...JSR

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-2007 All Rights Reserved.