jhunter at xquery.com
Wed Mar 31 23:07:04 PST 2004
I don't trust Notepad. It doesn't even know how to deal with Unix style
line endings. And when you try to save Foo.java it writes Foo.java.txt.
(Then when you try to change it back in Windows Explorer it says,
"Changing extensions is dangerous, are you sure you want to do this?"
Tell that to Notepad.)
> 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:
> 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.
> 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
> (<?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.
> So I'm wondering if it's just me or there is bug, or something.
More information about the jdom-interest