This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: XML -> XML preserving CDATA
- To: <xsl-list at lists dot mulberrytech dot com>
- Subject: RE: [xsl] XML -> XML preserving CDATA
- From: "Michael Kay" <mhkay at iclway dot co dot uk>
- Date: Wed, 12 Sep 2001 11:28:37 +0100
- Reply-To: xsl-list at lists dot mulberrytech dot com
> My source XML can contain different (unknown) elements with CDATA
> sections,
> 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>
and
<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
they choose.
Mike Kay
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list