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.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s