"Malcolm Dew-Jones" <> wrote in message
news:...
> Huzefa () wrote:
> : I have a XML file encoded in UTF-8. The parser works fine when
> : there are only English characters in the file.
>
> : However, when I PUT SOME Chinese characters in the file, I get the
> : following error:
>
> : org.xml.sax.SAXParseException: Content is not allowed in prolog.
>
> Perhaps you put some white space at the top of the file. The <? must be
> the very first thing, [snip]
I believe a Unicode Byte Order Mark (BOM) may precede the XML declaration.
Per the XML 1.1 TR:
"Entities encoded in UTF-16 MUST and entities encoded in UTF-8 MAY begin
with the Byte Order Mark described in ISO/IEC 10646" etc.
> and perhaps no white space before the first tag's <
> either.
I believe white space may appear in the prolog, after the XML declaration
and before or after the document type declaration.
[22] prolog ::= XMLDecl? Misc* (doctypedecl Misc*)?
[27] Misc ::= Comment | PI | S
/kmc
|