You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by Jeff Lansing <je...@polexis.com> on 2000/10/29 00:50:43 UTC

Carriage returns before newlines

Hi,
The xerces 1.2 SAXParser seems to be silently removing '\r's from the
character content of elements.
Is this expected? Controllable?
Jeff


Re: Carriage returns before newlines

Posted by Andy Clark <an...@apache.org>.
Jeff Lansing wrote:
> The xerces 1.2 SAXParser seems to be silently removing '\r's from 
> the character content of elements. Is this expected? Controllable?

Yes, this is expected from a compliant XML parser. All newline
combinations (including the DOS \r\n) is normalized to a single
newline character (\n) by the parser. [XML Spec 2.11]

If you really want to pass a carriage-return (\r) from the doc
to the application, then you have to escape it with a character
reference (&#13;).

-- 
Andy Clark * IBM, JTC - Silicon Valley * andyc@apache.org