| 2 | * [heikki] XML binding: |
| 3 | In the ebRIM branch, and in the Nordic Security code (not public yet), JiBX is used for Java <--> XML binding. It is highly useful to have such a binding, as it can be invoked automatically on Web Service communications and leads to a much cleaner dealing with objects in Java than when DOM/JDOM is used. One disadvantage of JiBX is that this binding needs to be written manually, which is a bit of a pain in the neck. Another disadvantage is that it is not a Java standard. JAXB on the other hand *is* the standard and comes with a binding-generator that takes a schema and produces the bound Java classes. |
| 4 | |
| 5 | However, I've tried running it on the ISO19139 schema and it does not work : |
| 6 | |
| 7 | {{{ |
| 8 | |
| 9 | ~/jaxb-ri-20110115/bin$ xjc -p testpackagename ~/source/ogc/ogc-schemas/trunk/iso/19139/20070417/schema/src/main/resources/iso/19139/20070417/gmd/gmd.xsd |
| 10 | |
| 11 | The result is : |
| 12 | |
| 13 | parsing a schema... |
| 14 | [ERROR] Property "Rows" is already defined. Use <jaxb:property> to resolve this conflict. |
| 15 | line 648 of file: |
| 16 | ~/source/ogc/ogc-schemas/trunk/iso/19139/20070417/schema/src/main/resources/gml/3.2.1/geometryPrimitives.xsd |
| 17 | |
| 18 | [ERROR] The following location is relevant to the above error |
| 19 | line 680 of file: |
| 20 | ~/source/ogc/ogc-schemas/trunk/iso/19139/20070417/schema/src/main/resources/gml/3.2.1/geometryPrimitives.xsd |
| 21 | |
| 22 | Failed to parse a schema. |
| 23 | |
| 24 | }}} |
| 25 | |
| 26 | This is because of peculiarities in the schemas that we cannot control. I have asked !users@ogc.java.net if it is possible to do this at all, but I'd be surprised. |
| 27 | |
| 28 | Question remains: if we cannot use JAXB to generate a binding for ISO19139, is it still desired to use JAXB for situations where we *can* use it, instead of using JiBX ? |
| 29 | |
| 30 | |
| 31 | |