<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1400" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Hi,</FONT></DIV>
<DIV><FONT face=Arial size=2>I got a few surprises while testing my program. I
wrote test XML file in notepad and saved it using UTF-8 encoding. To my surprise
I got a parsing exception thrown by SAXBuilder:</FONT></DIV>
<DIV><FONT face=Arial size=2>root-element is missing. When I saved same file
using other encodings - everything worked fine (btw file with UTF-8 encoding had
size 3 bytes bigger than others). But, though file was parsed and I could get
root's children by calling getChildren(), my atempt to get root's child by using
getChild(String name) failed, method returned a null pointer.</FONT></DIV>
<DIV><FONT face=Arial size=2>Same for getAttribute(String name), though
getAttributes() worked fine. In both cases there was only one element and one
attribute. I also tried XML file that was written by some one using XML editor
(do not know which one) and had encoding UTF-8</FONT></DIV>
<DIV><FONT face=Arial size=2>(<?xml version.... encoding="UTF-8"?>) to my
surprise (again) it worked. Program did not throw parsing exception, as with
file that was written using notepad and saved with UTF-8 encoding.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT><FONT face=Arial size=2>So I'm wondering if
it's just me or there is bug, or something.</FONT></DIV>
<DIV><FONT face=Arial size=2>Thanks</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV></BODY></HTML>