[jdom-interest] end-of-line character
kevinr at valicert.com
Thu Jul 6 11:14:08 PDT 2000
> tools ranging from simple text editors like emacs to Unix utils like
> cat to GUI FTP programs to custom Java software all have to be able
> to read and write XML files without knowing squat about XML. \r\n is
> the standard line terminator used in more network protocols than
> anything else. Most network software that implements protocols that
> require \r\n (HTTP for example) is fairly forgiving of non-standard
> requests that use \n instead of \r\n but there's always something out
> there that isn't and actually expects authors to adhere to the spec.
> Furthermore, it is not acceptable for JDOM output to be platform
> dependent. A simple program that creates a document in memory with no
> user input or random characteristics and serializes it should produce
> byte-for-byte identical output on Windows, the Mac, and Unix. It
> should not change from platform to platform. This is important for
> digital signatures, among other use cases.
I see your point on some of these. However, what about the
1) Xml in the data of an HTTP request. This is handled by setting
an explicit size for the data. So, the terminating character is
not important. Actually, this should be true of most protocols
that an XML document will be sent over. It is unlikely (except
in a few cases) for the end-of-line information to be interpreted
by the protocol.
2) Digital Signatures -- end-of-line markings will have no effect on
digital signatures. XML canonicalization expects the standard
validating parser normalizations before the first step of
I tend to agree that it would be better to have a standard output.
I'm only a little hesitant because I know the garbage that windows
text editors and unix text editors will throw out when given the
wrong end-of-line sequence.
More information about the jdom-interest