[jdom-interest] XML standard line ending

Elliotte Rusty Harold elharo at metalab.unc.edu
Thu Mar 11 13:46:39 PST 2004

At 8:53 PM +0000 3/11/04, Rick Beton wrote:
>One thing that puzzles me is org.jdom.output.Format.java:128.  Why 
>is the standard line ending CR NL?  It would be natural to use the 
>machine default, \

No, it would not. It is very damaging to have the same program emit 
different output merely because the platform changes. PrintStream is 
traditionally problematic for precisely this reason.

The specific choice of \r\n was made because this is the network 
standard line ending convention mandated by HTTP among many other 
protocols. However, if you want to set something else, you are free 
to do so.

   Elliotte Rusty Harold
   elharo at metalab.unc.edu
   Effective XML (Addison-Wesley, 2003)

More information about the jdom-interest mailing list