This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes How to preserve linefeed in XML file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "How to preserve linefeed in XML file" Watch "How to preserve linefeed in XML file" New topic
Author

How to preserve linefeed in XML file

jonathan ford
Greenhorn

Joined: Feb 16, 2008
Posts: 4
I have a XML file looks like:
<Content>Hello
everyone, how
are you
doing today?
</Content>
when I use IE to open the file, it looks like:
<Content>Hello everyone, how are you doing today?</Content>

Anyone can provide suggestion? Thanks
Paul Clapham
Sheriff

Joined: Oct 14, 2005
Posts: 19728
    
  10

Now try it with:See what's happening? IE is "pretty-printing" the XML. It will indent child elements on a new line, for example, and that isn't consistent with preserving whitespace within text nodes.

I can't see where this would be a real problem. You were just curious, right?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to preserve linefeed in XML file
 
It's not a secret anymore!