Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

XML "Document root element is missing"

843834Aug 2 2005 — edited Aug 3 2005
i have made a research in the forums but i have no definite solution about the error.
my flash client sends XML stream to my ServerSocket. and i want to parse these XML datas.
Document XMLDoc;
DocumentBuilderFactory Factory = DocumentBuilderFactory.newInstance();
DocumentBuilder Builder = Factory.newDocumentBuilder() ;
InputSource Is = new InputSource(new BufferedReader(new InputStreamReader(Sock.getInputStream(),"UTF-16LE")));
XMLDoc = Builder.parse(Is);

But now i have problem called "Document root element is missing". My XML stream comming from flash client :
// Actionscript code :
XDoc = new XML("<?XML version=\"1\"?><LOGIN><USERNAME>KHARON</USERNAME><PASSWORD>485009</PASSWORD></LOGIN>");

----- The XML data i want to sent to ...
<?XML version="1"?>
<LOGIN>
<USERNAME>KHARON</USERNAME>
<PASSWORD>485009</PASSWORD>
</LOGIN>
-----
What is the problem ?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 31 2005
Added on Aug 2 2005
5 comments
595 views