OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Keep XML parser from eating linefeed in element data ??

[ Lists Home | Date Index | Thread Index ]
  • To: <xml-dev@lists.xml.org>
  • Subject: Keep XML parser from eating linefeed in element data ??
  • From: "Andy Rappaport" <Andy@bladelogic.com>
  • Date: Thu, 9 Jan 2003 19:13:48 -0500
  • Thread-index: AcK4PP4qe478F1owTwGhkpf77uQaPA==
  • Thread-topic: Keep XML parser from eating linefeed in element data ??

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? 

 

Raw String:           Hello world\n    <-note trailing linefeed. 

 

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. 

 

Any ideas or references?

 

 

Thanks,

Andy





 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS