This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
    Bookmark Topic Watch Topic
  • New Topic

Content is not allowed in prolog  RSS feed

 
YuenLian Wu
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hi All,

I am currently facing a very annoying problem. I have a Java program that will read a "xml" file and convert it to bytes, and then the program will convert the bytes to string in order to pass them into XSL. Here is the code :



However, when the parser try to parse the string into xml format, it threw the org.xml.sax.SAXParseException, and it said "Content is not allowed in prolog". After my observation, I found out the encoded string variable called "mytext" has a question mark in front of the XML header. This is strange because I don't put a question mark before the header, and I am sure I use the UltraEdit to set the encoding into "UTF-8". Here is the header of my xml file:



I tried to debug this problem by display the string "mytext" into the console and I found out the result contains the following :

It has a question mark, which it's not supposed to happen, that's why it gave me the exception.

I am currently using WSAD 5.1.2 with JDK 1.3, is that a cause of the problem? Please help me out here because I am getting sick of this.

Thanks in advance

Transistor
 
Joe Ess
Bartender
Posts: 9428
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please do not post the same question in more than one forum. People here read more than one forum so you aren't increasing your audience and you can cause duplication of effort as the community answers both your posts independently.
 
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!