"content is not allowed in prolog" using Oxygen fo

Having trouble installing Oxygen? Got a bug to report? Post it all here.
joshuajnoble
Posts: 1
Joined: Thu Jun 01, 2006 6:28 pm

"content is not allowed in prolog" using Oxygen fo

Post by joshuajnoble »

I'm trying to use Oxygen to edit MXML files (Macromedia Flex). Everything works fine except that this error always appears: content is not allowed in prolog. What's up with this? Here's the line it chokes on:

<?xml version="1.0" encoding="utf-8"?>

This is the way all Flex files start and there don't seem to be any problems there. Anybody know what's up?
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Post by sorin_ristache »

Hello,

The first character must be <, so the BOM of that file is corrupted or the file contains some invisible characters before the < character. If you create a new XML file and you type at the beginning

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
the error does not appear.

Regards,
Sorin
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Post by george »

See also my reply on the mailing list
http://www.oxygenxml.com/pipermail/oxyg ... 00808.html
You have a UTF-16 BOM before the XML header.

Best Regards,
George
Marc R.
Posts: 7
Joined: Fri Aug 31, 2007 4:15 pm
Location: France

same, but with oxygen native file

Post by Marc R. »

Hello,

I have a similar error "org.xml.sax.SAXParseException: Content is not allowed in prolog."
I'm using oxygen 8.2 on winXP and trying to produce a PDF using the internal FOP engine.
(fyi my Java runtime is "1.3.1_01")

After having done some googleing, I saw that it could come from cut&paste issues from external editors (I indeed sometime use UltraEdit). So I tried from scratch within oxygen, creating an almost empty xml source file (only the declarations). And I get the same error.

My file is suposedly UTF-8 encoded. In a binary viewer I see it starts with FF FE before the 3C ("<").

Maybe an important clue: this only occurs when trying to generate PDFs (whether is is using FOP or TEI). No issue when transforming into html or other xml using the same xsl-fo file.

Any help would be greatly appreciated, as I enjoy quite a lot working with oxygen, but already spent a few hours on this blocking problem.

Thanks a lot in advance
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: same, but with oxygen native file

Post by sorin_ristache »

Hello,
Marc R. wrote:(fyi my Java runtime is "1.3.1_01")
oXygen does not support Java versions older than 1.4.2.
Marc R. wrote:So I tried from scratch within oxygen, creating an almost empty xml source file (only the declarations). And I get the same error.

My file is suposedly UTF-8 encoded. In a binary viewer I see it starts with FF FE before the 3C ("<").
Is the option BOM handling set to Write in Options -> Preferences -> Global?


Regards,
Sorin
Marc R.
Posts: 7
Joined: Fri Aug 31, 2007 4:15 pm
Location: France

Post by Marc R. »

Thanks for your answers.

I checked my java version, I had an issue with the paths (I knew I had a more recent version than 1.3, and it was caused by and Oracle distribution of the old jre). Now it says 1.6.0.2, which is correct.

And yes the option is set to "write" for the BOM handling, but the error still occurs.
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: same, but with oxygen native file

Post by sorin_ristache »

Marc R. wrote:So I tried from scratch within oxygen, creating an almost empty xml source file (only the declarations). And I get the same error.

My file is suposedly UTF-8 encoded. In a binary viewer I see it starts with FF FE before the 3C ("<").
Marc R. wrote:And yes the option is set to "write" for the BOM handling, but the error still occurs.
If the option is set to Write oXygen adds a BOM marker to the XML file but the BOM marker for UTF-8 is not FF FE. Does the XML file begin with an UTF-8 declaration like the following?

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
Please specify more detailed steps for reproducing the error in oXygen from create the file to transform the file to PDF.


Regards,
Sorin
Marc R.
Posts: 7
Joined: Fri Aug 31, 2007 4:15 pm
Location: France

Post by Marc R. »

Marc R. wrote: And yes the option is set to "write" for the BOM handling, but the error still occurs.
I found a solution. I extracted the default fop config file from the fop 0.93 official binary release, set it up in the options>FO processor and now it works, no more errors with the prolog.

Thanks for your help anyways!
Post Reply