RSS Forums RSS
Please support our Java advertiser: Lunarpages Java Web Hosting
Views: 550 | Replies: 9 | Solved | Thread Tools  Display Modes
Reply
Join Date: Sep 2006
Posts: 26
Reputation: JyotiC is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 1
JyotiC JyotiC is offline Offline
Light Poster

xml to object and vice versa

  #1  
Jul 23rd, 2008
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
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jun 2008
Location: new york
Posts: 343
Reputation: sciwizeh is on a distinguished road 
Rep Power: 1
Solved Threads: 17
sciwizeh's Avatar
sciwizeh sciwizeh is offline Offline
Posting Whiz

Re: xml to object and vice versa

  #2  
Jul 23rd, 2008
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
My site, random PM's from people I haven't hear from before will be DELETED
"If people are good only because they fear punishment, and hope for reward, then we are a sorry lot indeed.",
"If we knew what it was we were doing, it would not be called research, would it? "
-Albert Einstein
Reply With Quote  
Join Date: Sep 2006
Posts: 26
Reputation: JyotiC is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 1
JyotiC JyotiC is offline Offline
Light Poster

Re: xml to object and vice versa

  #3  
Jul 26th, 2008
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
Reply With Quote  
Join Date: Jun 2008
Location: new york
Posts: 343
Reputation: sciwizeh is on a distinguished road 
Rep Power: 1
Solved Threads: 17
sciwizeh's Avatar
sciwizeh sciwizeh is offline Offline
Posting Whiz

Re: xml to object and vice versa

  #4  
Jul 26th, 2008
well there are parser generation programs, that probably will do it for you
My site, random PM's from people I haven't hear from before will be DELETED
"If people are good only because they fear punishment, and hope for reward, then we are a sorry lot indeed.",
"If we knew what it was we were doing, it would not be called research, would it? "
-Albert Einstein
Reply With Quote  
Join Date: Sep 2006
Posts: 26
Reputation: JyotiC is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 1
JyotiC JyotiC is offline Offline
Light Poster

Re: xml to object and vice versa

  #5  
Jul 28th, 2008
Thanks!
This sounds good. Any suggestions for parser generator tool?

Regards,
Jyoti
Reply With Quote  
Join Date: Jun 2008
Location: new york
Posts: 343
Reputation: sciwizeh is on a distinguished road 
Rep Power: 1
Solved Threads: 17
sciwizeh's Avatar
sciwizeh sciwizeh is offline Offline
Posting Whiz

Re: xml to object and vice versa

  #6  
Jul 28th, 2008
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
My site, random PM's from people I haven't hear from before will be DELETED
"If people are good only because they fear punishment, and hope for reward, then we are a sorry lot indeed.",
"If we knew what it was we were doing, it would not be called research, would it? "
-Albert Einstein
Reply With Quote  
Join Date: Sep 2006
Posts: 26
Reputation: JyotiC is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 1
JyotiC JyotiC is offline Offline
Light Poster

Re: xml to object and vice versa

  #7  
Jul 30th, 2008
Thanks!
Reply With Quote  
Join Date: Jun 2008
Location: new york
Posts: 343
Reputation: sciwizeh is on a distinguished road 
Rep Power: 1
Solved Threads: 17
sciwizeh's Avatar
sciwizeh sciwizeh is offline Offline
Posting Whiz

Re: xml to object and vice versa

  #8  
Jul 30th, 2008
so that's all you need?
My site, random PM's from people I haven't hear from before will be DELETED
"If people are good only because they fear punishment, and hope for reward, then we are a sorry lot indeed.",
"If we knew what it was we were doing, it would not be called research, would it? "
-Albert Einstein
Reply With Quote  
Join Date: Sep 2006
Posts: 26
Reputation: JyotiC is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 1
JyotiC JyotiC is offline Offline
Light Poster

Re: xml to object and vice versa

  #9  
Jul 31st, 2008
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!
Reply With Quote  
Join Date: Jun 2008
Location: new york
Posts: 343
Reputation: sciwizeh is on a distinguished road 
Rep Power: 1
Solved Threads: 17
sciwizeh's Avatar
sciwizeh sciwizeh is offline Offline
Posting Whiz

Re: xml to object and vice versa

  #10  
Jul 31st, 2008
no problem
My site, random PM's from people I haven't hear from before will be DELETED
"If people are good only because they fear punishment, and hope for reward, then we are a sorry lot indeed.",
"If we knew what it was we were doing, it would not be called research, would it? "
-Albert Einstein
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.



Other Threads in the Java Forum
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 8:14 pm.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC