Currently I have a bunch of XML files. Unfortunately, there is no XSD or any other schema file. Within my program (Java) I use JiBX to (un-)marshal XML files from/to POJOs. Consequently, my question is: Is there a way (by using JiBX) to create a XSD based on the structure coming from a sample XML file? I need to do this automatically, because the structure of these XML files is very complex. Btw: I need the XSD in order to create POJOs automatically. This requirement is related to the complexity as well.
Why not using any other solution different to JiBX? Generally, I will accept different solutions, but it would be great doing it with JiBX. That is because the next step would be doing it based on some automatism (e.g. Ant job).
Nevertheless, just for playing around, I already tried Oxygen. It creates some XSD schema based on one sample XML file, without running into errors. The result of this procedure is (some how) not as expected. For instance, when there is a String inside of an element tag, Oxygen creates further XSD sub-element rules. As a result, when unmarshaling the XML file, these Strings disappearing.
Maybe I am on a wrong path to a solution? Please give me assistance/ideas helping to solve the problem.
Thank you very much indeed.