xsl-list
[Top] [All Lists]

RE: [xsl] CDATA Handling

2009-01-06 04:42:07
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(_at_)aptaracorp(_dot_)com] 
Sent: 06 January 2009 05:56
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com; 
xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] 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



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



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