DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   Java (http://www.daniweb.com/forums/forum9.html)
-   -   xml to object and vice versa (http://www.daniweb.com/forums/thread136234.html)

JyotiC Jul 23rd, 2008 7:56 am
xml to object and vice versa
 
Hi,

I have an xml file, corresponding to an xsd. If there some tool, which would take this xml and xsd and give me an object. And also take the object and xsd and give me xml.

I read about couple of tools like JAXB, xstrem and xmlBeans.
The issue i have with them, is they make their own classes, i want to use classes which i have already defined by my object. And it's not similar to the ones they create.

Is there any other tool, which also takes classes and use that for object?

Regards,
Jyoti

sciwizeh Jul 23rd, 2008 3:43 pm
Re: xml to object and vice versa
 
you could write your own XML parser with SAX or DOM, i'm not sure but i think DOM is the one that allows XSD, but i haven't messed around with it much :(

hope it helps :)

JyotiC Jul 26th, 2008 10:54 am
Re: xml to object and vice versa
 
Yes, writing parser is always an option. Looks like i would have to do that only.
But was just wondering if there is a tool, which would do all the work :).

Regards,
Jyoti

sciwizeh Jul 26th, 2008 7:37 pm
Re: xml to object and vice versa
 
well there are parser generation programs, that probably will do it for you

JyotiC Jul 28th, 2008 12:19 am
Re: xml to object and vice versa
 
Thanks!
This sounds good. Any suggestions for parser generator tool?

Regards,
Jyoti

sciwizeh Jul 28th, 2008 10:22 am
Re: xml to object and vice versa
 
the only generation tool that i can think of at the moment is JavaCC, but i know there are more of them, try google for more options, if
parser generator
doesn't turn up anything you want try adding xml to it

JyotiC Jul 30th, 2008 8:45 am
Re: xml to object and vice versa
 
Thanks!

sciwizeh Jul 30th, 2008 12:08 pm
Re: xml to object and vice versa
 
so that's all you need?

JyotiC Jul 31st, 2008 8:02 am
Re: xml to object and vice versa
 
Yeah, i was just looking for different ways for solving this problem.
I am thinking of using jaxb for object to xml, and use parser to change map objects.

For xml to object, looks like i'd have to do a complete parser.

Thanks for your help!

sciwizeh Jul 31st, 2008 10:42 am
Re: xml to object and vice versa
 
no problem


All times are GMT -4. The time now is 2:37 am.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC