Akacem Mohammed wrote:

I have the probleme that the SaxParser when parsing a string is presumely replacing \r\n throught \n.
Has someone an idea how I could avoid this? I actually need the carriage return (\r) because the string will be displayed later on on a client (win) . ( now I am simply adding the carriage return, but I think there should be a better solution).

Any XML-compliant implementation will do this when reading in the document. It's required by the XML specification (http://www.w3.org/TR/REC-xml):

2.11 End-of-Line Handling

XML parsed entities are often stored in computer files which, for
editing convenience, are organized into lines. These lines are
typically separated by some combination of the characters
carriage-return (#xD) and line-feed (#xA).

To simplify the tasks of applications, the characters passed to an
application by the XML processor must be as if the XML processor
normalized all line breaks in external parsed entities (including
the document entity) on input, before parsing, by translating both
the two-character sequence #xD #xA and any #xD that is not followed
by #xA to a single #xA character.

A Windows SOAP implementation should do the same thing - if it doesn't, it's broken.

- Dennis

Dennis M. Sosnoski
Enterprise Java, XML, and Web Services Support
http://www.sosnoski.com
Redmond, WA 425.885.7197



Reply via email to