ASCII control characters in CDATA section

Nowhere

Usenet Archive
Joined
Nov 27, 2003
Messages
32
Reaction score
0
Hi,

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.

My question is: Should I be using a different character set (not UTF-8) or is this a bug in expat?

TIA, Mark
 

Martin Honnen

Usenet Archive
Joined
Apr 8, 2000
Messages
6,174
Reaction score
0
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.

My question is: Should I be using a different character set (not UTF-8) or is this a bug in expat?

I don't think so, with XML all line endings are normalized http://www.w3.org/TR/REC-xml#sec-line-ends so even a CDATA section doesn't help to preserve a carriage return
 

Richard Tobin

Usenet Archive
Joined
Jan 6, 2000
Messages
4,251
Reaction score
0
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 (
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
548,208
Messages
3,104,799
Members
249,594
Latest member
henrywalsh

Latest Threads

Top