What is Xsd2Jibx?Xsd2Jibx gives you a way to generate an initial set of Java classes, and the corresponding JiBX binding definition, from a W3C XML Schema input document. The generated classes and binding give you a starting point for working with XML documents matching the schema, which you can then refactor as appropriate to suit your needs. The big difference from other data binding frameworks that generate code from schemas is that in the Xsd2Jibx case the generated code is under your control. You can modify the code, changing the binding definition if necessary, while continuing to work with documents matching the original schema. You can also keep working with the original generated classes even as the schema evolves, so long as you can compensate for the schema changes in the binding definition. Current featuresFeatures supported by the current Beta 0.2a release include:
Limitations of the Beta 0.2a release are:
Changes since Beta 0.2:
Running Xsd2JibxThe easiest way to set up Xsd2Jibx for use is to copy the jibx-run.jar and xpp3.jar files from the lib directory of your JiBX installation to the lib directory of your Xsd2Jibx installation. Once you've done this you can run the Xsd2Jibx tool from the console using a command of the form (on Unix/Linux; you'll need to change the path and directory separators for Windows): java -jar xsd2jibx-root/lib/xsd2jibx.jar [options] schema1.xsd schema2.xsd ... where xsd2jibx-root is the path to the root directory of your Xsd2Jibx installation, the table below gives the options supported by the tool, and the schema#.xsd files are the one or more schemas to be used to generate Java code.
You can also run Xsd2Jibx without copying the files from the JiBX installation
into the Xsd2Jibx installation, but in this case you need to explicitly include
the two JiBX jars mentioned above in the classpath along with the
xsd2jibx.jar, and need to specify the main Java class as
Future changesThe current Xsd2Jibx code is likely to be rewritten in the future to improve support for schema and take advantage of new features in JiBX. The replacement code will also be much more robust than the current code. |