How can I use JAXB for XML having no schema definitions?
-
- I have some XML files that I need to parse and use them as POJO - These XML files doesn't have any schema definitions(.xsd) associated with them. They all look same though, I mean the schema can be handcoded - How can I use JAXB in this situation?
-
Answer:
You can add JAXB annotations to existing Java objects to map them to the desired XML format. You do need to generate a JAXB model from an XML schema.
Blaise Doughan at Quora Visit the source
Other answers
inst2xsd from xmlbeans (http://xmlbeans.apache.org) creates an xsd from xml instances. Sometimes it needs a bit of cleanup, but most of the time, the chain inst2xsd -> xjc -> jaxb works very well for me.
Hans-Peter Zorn
Related Q & A:
- How can I use SSL with django?Best solution by Stack Overflow
- How can I use XMP in Sharepoint metadata?Best solution by Stack Overflow
- How can I detect changes in XML?Best solution by Stack Overflow
- How can I parse a complex XML with PHP and CDATA?Best solution by Stack Overflow
- How can I make JAXB-generated classes participate in a visitor pattern?Best solution by Stack Overflow
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.