[jdom-interest] Why why why?......Duplicate Elements?

Johnny Cash meaneyedcat at hotmail.com
Fri Mar 30 05:52:31 PST 2001


Could someone please explain to me why when I run this code:

Element root = doc.getRootElement();
System.err.println(root.getName());

List l = root.getChildren();

for (int i = 0; i < l.size(); i++) {
     Object obj = l.get(i);
     if (obj instanceof Element) {
        Element e = (Element) obj;
        System.err.println(e.getName());
	System.err.println(e.getContent());
     }
     if (obj instanceof String) {
	System.err.println(obj);
     }
}

on this XML:

<girl>
    <eyes></eyes>
</girl>

I get this output:

girl

eyes


eyes


Where do the extra Strings come from? Why are there to "eyes" elements?
FYI: I am using JDOM beta 6.

Thanks for any help!
Aaron.
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.




More information about the jdom-interest mailing list