Re: [xml-dev] Keep XML parser from eating linefeed in element data ??

From
Karl Waclawek <>
To
Andy Rappaport <>,
Date
2003-01-10T01:22:44Z
ID
<001e01c2b846$c6ee1b30$0207a8c0@karl>
Thread
Re: [xml-dev] Keep XML parser from eating linefeed in element data ??
----- Original Message ----- 
From: "Andy Rappaport" <>

> Hello
> 
> Does anyone know how I can encode a raw line feed as part of XML element
> data such that
> 
> when the parser returns it to me the linefeed remains? =20
> 
> Raw String:           Hello world\n    <-note trailing linefeed. =20
> 
> I can encode it to:  <TAG>Hello world&#10;</TAG>
> 
> Returned string      Hello world  <-no trailing linefeed
> 
> My XML parser,  expat SAX, always eats the linefeed.   Carriage returns
> can be encoded fine and parsed fine.
> 
> Anything thing I have been able to find on XML char encoding always
> lists linefeed as an exception to the rules. I've tried CDATA - no luck.

Many SAX parsers will report character data in multiple calls.
Is it possible that you are ignoring subsequent call-backs
to the character data handler?

Karl