[XSL-LIST Mailing List Archive Home]
RE: [xsl] XML -> XML preserving CDATA
Subject: RE: [xsl] XML -> XML preserving CDATA|
From: "Michael Kay" <mhkay@xxxxxxxxxxxx>
Date: Wed, 12 Sep 2001 11:28:37 +0100
> My source XML can contain different (unknown) elements with CDATA
> which should be copied preserving the CDATA sections untouched.
> How can this be done?
It can't; but it shouldn't matter. The XSLT/XPath specs take the view that
CDATA is purely an input convenience to save you having to escape special
characters; it doesn't affect the information content of a document. So
<foo><![CDATA[ Chic&Apart ]]></foo>
<foo> Chic&Apart </foo>
are precisely equivalent. Most XSLT processors will output the latter, but
it shouldn't make any difference to subsequent users of the document which
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list