This week's book giveaway is in the OCP forum.
We're giving away four copies of OCP Java SE 8 Programmer II Exam Study Guide and have Kathy Sierra, Bert Bates, & Elizabeth Robson on-line!
See this thread for details.
Win a copy of OCP Java SE 8 Programmer II Exam Study Guide this week in the OCP forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

SAXParseException: Document root element is missing  RSS feed

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all ,
I am getting the following error
org.xml.sax.SAXParseException: Document root element is missing
while building our application. Problem is the build file refers an XML which has Japanese character. If I remove those character the build is happening, which is not the right way. Herewith I am attaching the XML also. The XML is well formatted.
Kindly give me your suggestions to get rid of the problem. I am using Xalan 2.5.1.


The XML snippet is as follows:

<?xml version="1.0" encoding="UTF-8" ?>
<translations>
<entry>
<key>SITE_TITLE</key>
<error_number />
<translation lang="en">Sites</translation>
<translation lang="en_US">Sites</translation>
<translation lang="ja">サイト</translation>
</entry>
<entry>
<key>CREATE_SITE_TITLE</key>
<error_number />
<translation lang="en">Add a Site</translation>
<translation lang="en_US">Add a Site</translation>
<translation lang="ja">サイトを追加</translation>
</entry>
</translations>


Please reply ASAP.

Thanks in advance!
 
author and deputy
Bartender
Posts: 3150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Open your xml file using good IDE tools like XMLSPY and save your XML file again... this will make sure that your xml is fully based on UNICODE... this will let xalan to parse the xmlfile.

Will that help ?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!