In article <hs********************************@4ax.com>,
<no*****@home.com> wrote:
I need to preserve some ASCII control characters (CR and LF) within an
XML file so I have included the data in a CDATA section. However,
when parsing it using expat, I lose the CR characters.
To preserve CRs, you need to use character references (
), because
CR and CR-LF are normalized to LF when an XML document is read.
You can't use character references in a CDATA section, so it's
probably better to forget about CDATA and just escape any characters
that need it. The main use for CDATA is preserving human readability
of text that includes < and & characters, such as XML examples inside
an XML document. It doesn't really work for arbitrary data.
-- Richard
--
Spam filter: to mail me from a .com/.net site, put my surname in the headers.
FreeBSD rules!