posted 17 years ago
I don't think your code is doing anything much. And I'm not even sure it will run correctly if you run it. For example this:gets you a list of seven "uni" elements. (At least I think it does, I'm not really familiar with JDOM but that seems like the most reasonable thing for it to do.) But then you do this:And that, I think, should throw a ClassCastException. I wouldn't expect to be able to cast a List to an Element.
So, you might want to have a look at some JDOM tutorials. (The easiest way to find them is to stick "jdom tutorial" into your favourite Internet search engine and look at what comes back, but beware of old tutorials because JDOM went through a number of changes before version 1.0 was finalized.) Here is one that isn't too old, for example.
If you just want to put those seven "uni" elements into an array, then you have them in a List already so it's easy to get an array from that List. But I suspect your requirements will go beyond that once you get used to working with XML. So take some code from the tutorials and fiddle around with it.