This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: XML -> XML preserving CDATA


> 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&amp;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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]