Click to See Complete Forum and Search --> : XML to Object


Dark Ninja
06-02-2004, 11:54 AM
I've been searching the web, and I even purchased a book -- but, I'm having trouble figuring out how to convert an XML document to a Java object and then back.

It seems like it should be easy, and I could even write my own parser, but I know there are classes out there that already do this and I would like to do this.

Can anybody point me in a direction to get my started. Thanks.

maccorin
06-02-2004, 03:52 PM
i don't know of a pre-existing class that does it for you automatically, that would be a bit difficult, because they don't know what your class should look like...

if you want to write your own, look into DOM

Dark Ninja
06-02-2004, 04:13 PM
Yeah, I have been looking into that, actually (SAX as well...although DOM seems more in tune with what I'm going to need).

What confuses me is that there seems to be so many different ways to use DOM. I think I'm getting myself confused with the different parsers that exist (even though it seems DOM is already supported in Java) and how to use these parsers -- or if I even need to use these parsers.

I've been searching the web for tutorials on DOM, but I haven't found a whole lot that seems to be of use. If you can point me in a direction, I'd appreciate it.

maccorin
06-02-2004, 04:19 PM
try not looking for a language specific DOM tutorial, there are tons of dom tutorials on the web, and the interface should be similar, regardless the language.