xml parse line break, line feed lost

\n or line break or line feed in a string would be stripped by xml parser and replaced by space.

According to XML specification, any white space will be normalized into #xA;

In order to preserve the line feed, we can just replace all the \n with which is the legal line feed in XML. So when we later retrieve the String data from DOM, it will put \n back.

Leave a comment