| Author |
XML parsing | SAX / STAX
|
Gurvinder Singh
Greenhorn
Joined: Nov 10, 2008
Posts: 27
|
|
Hi
I have a simple question to ask regarding the xml parsing logic.
My requirement is that i will get an xml file with the feed data of the products. And i want to import it to my database.
For this i am using STAX api for xml parsing.
Now my question is, is there a way that i get a list of objects with all the parsed xml data in those objects.
I have generated Xsds from Xml and from Xsds I have generated java objects.
Now instead of doing that in the code to manually set all the values in the objects and then return the list of objects to the calling api,
i want to know if there is some api available that reads the XSDs and xml and returns me List<objects> with the data in those objects?
Thanks
|
 |
Paul Clapham
Bartender
Joined: Oct 14, 2005
Posts: 16483
|
|
|
There's a variety of Java-to-XML binding tools, yes. Some of them work based on schemas but it's not necessarily a requirement. I don't know if they will work with Stax parsers -- but why is that a requirement?
|
 |
Gurvinder Singh
Greenhorn
Joined: Nov 10, 2008
Posts: 27
|
|
The requirement is that i have a pretty complex xml structure that may change in the future.
So to save time from coding again, we want that the xml be parsed and the list of value objects be returned and we use them directly.
If this can be done via any other xml parsing api other than STAX then please suggest.
|
 |
Paul Clapham
Bartender
Joined: Oct 14, 2005
Posts: 16483
|
|
|
You still haven't said why you are focusing on a choice of parsers. That's all backwards. You should first be looking at those Java-to-XML binding tools and deciding which one fits your requirements.
|
 |
 |
|
|
subject: XML parsing | SAX / STAX
|
|
|