Line End Trade-Offs

The idea here is that a programmer need never have to wrestle with the fact that Windows boxes, Macintoshes, and Unix systems all use different characters to separate lines. Since XML documents will be stored in files on all these systems, and will often be broken up into lines, it's absolutely certain that these documents will use all these different combinations of carriage-return and line-feed.

But as a programmer using an XML processor, you can count on never seeing anything but a single line-feed character separating lines. This means your code will run anywhere.

Since the publication of the spec, we have received a certain number of complaints from Microsoft Windows programmers, who find it surprising and disturbing that the data they receive from the XML processor has "weird, unconventional" line separation. Given the relative number of Windows programmers, it might have been a good idea to adopt the Windows-standard CR-LF as the line separator signal, as opposed to the single LF; but it's too late for that now.

Back-link to spec

Copyright © 1998, Tim Bray. All rights reserved.