xmerl - \n\r

Helmut Enck-Radana her@REDACTED
Fri Jun 23 22:57:41 CEST 2006


At 15:02 2006-06-23, Sanjaya Vitharana wrote:
[...]
>Reason: "escape characters" (\n\r) or "Space" in the beginning of 
>file as below.
[...]
>Question:
>1.) <?xml version="1.0"?> -- must be in the staring point of a xml file ???

According to
http://www.w3.org/TR/2004/REC-xml-20040204/#sec-well-formed
the XML-declaration must not be preceeded by anything except a byte-order mark.
This is also explained in
http://www.w3.org/TR/2004/REC-xml-20040204/#sec-guessing.

The XML-declaration is not necessary, when the encoding is UTF-8, 
UTF-16 or US ASCII.
If there is no XML-declaration, an XML entity may start with white 
space characters, according to
http://www.w3.org/TR/2004/REC-xml-20040204/#NT-prolog.

-- Helmut





More information about the erlang-questions mailing list