aspose file tools*
The moose likes XML and Related Technologies and the fly likes Parsing Exception with JAXB 1.0.6 : XML files containing UTF-8 characters   Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Parsing Exception with JAXB 1.0.6 : XML files containing UTF-8 characters   " Watch "Parsing Exception with JAXB 1.0.6 : XML files containing UTF-8 characters   " New topic
Author

Parsing Exception with JAXB 1.0.6 : XML files containing UTF-8 characters

sumitha sudhakar
Greenhorn

Joined: Aug 09, 2010
Posts: 21
Hi,

My application is using JAXB 1.0.6 and JDK 1.4, When am trying to parse some XML files which contatining some UTF-8 characters, parsing has failed.
Here is the code which am using

this throws the following exception:
**************************************
javax.xml.bind.UnmarshalException: Content is not allowed in prolog.
- with linked exception:
[org.xml.sax.SAXParseException: Content is not allowed in prolog.]
Please help me out. how can i unmarshall an XML file having UTF 8 char encoded.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12806
    
    5
Why are you so sure the problem is UTF-8?

Content is not allowed in prolog.


can simply mean the first character in the stream is not a < - the parser expects the first line to start <?xml

If this was my problem I would take a close look at the initial characters.

Bill
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Parsing Exception with JAXB 1.0.6 : XML files containing UTF-8 characters