users@xerces.apache.orgSubject: RE: Reading
UTF-16: Content is not allowed in prolog
There is one other case
where you will get this error. That’s where you include a prolog that
declared the data as UTF-16, but the actual data written was NOT truly
UTF-16. Here is a snippet I use to write
ct: Re: Reading UTF-16: Content is not allowed in
prolog
[Fatal
Error] output.xml:1:40: Content is not allowed in prolog.
You have something other than
the Byte Order Mark, the XML Declaration, Processing Instructions, or
whitespace before the document's root element. Fix the file s
Hi David,
The encoding declared in your document (in the XML declaration) and the
actual encoding of your document probably don't match after you've
serialized it to a file. You should be passing a FileOutputStream to the
transformer and let it handle the character encoding instead of using a
[Fatal Error] output.xml:1:40: Content is not allowed in prolog.
You have something other than the Byte Order Mark, the XML Declaration, Processing Instructions, or whitespace before the document's root element. Fix the file so it's well-formed XML.
__
"...