I've been working on a subproject of JiBX which takes an XML Schema and produces Java source files and a JiBX binding definition file. The first beta of xsd2jibx is nearing release and the examples I've been preparing are ones I think this project and Geotools project can benefit from. The code that I checked in today supports the WMS 1.3.0 capabilities schema and example at http://schemas.opengis.net/wms/1.3.0/. I had JiBX unmarshal the example capabilites.xml and out the attached xml. They data *should* be identical.
JiBX takes a different approach than the other data binding apps like JAXB. It allows you to map your existing objects to an XML structure, similar to how Hibernate allows you to map your objects to a relational database. Unlike Hibernate, it doesn't use reflection. It compiles the bindings into the bytecode of the class files. It also uses XMLPull rather than SAX. It is fast and flexible and is starting to pick up a lot of interest. I think it can be used to improve performance of geoserver and make the XML handling easier to maintain.
Essentially, xsd2jibx will produce reference code and a refering binding definition needed to support an XML structure that conforms to an XML Schema. To add support to your code, you can then adjust the binding definition as necessary or add your additional properties and methods to the produced source files. Somehow, they must be synced, but this is much easier IMHO than dealing with SAX or DOM.
I'm now working on the SLD 0.7.2 example, since that is what I believe geotools currently supports. If there are other XSD's that are in high demand let me know. I would however, not like to tackle the most diffiicult ones to begin with (I've heard stories of GML 3). I could really use some more test XM's from both WMS 1.3.0 and SLD 0.7.2. If any of you are interested in checking out the CVS code and trying out the WMS example, let me know and I'll provide instructions (I need more testers. :] ).
Thanks,
Cameron
(attachments)
wms_capabilities1.xml (9.25 KB)