Domanda

I'm working on two large 3rd party schemas, one includes the other and generates a large number of type name collisions. If I could set the package on a namespace this problem would go away.

I hoped something like

<jaxb:bindings namespace="http://www.openapplications.org/oagis/9" >
    <jaxb:schemaBindings>
        <jaxb:package name="org.oagis" />
    </jaxb:schemaBindings>
</jaxb:bindings>

would work, or perhaps

<jaxb:bindings node="/xsd:schema[@targetNamespace='http://www.openapplications.org/oagis/9']">
    <jaxb:schemaBindings>
        <jaxb:package name="org.oagis" />
    </jaxb:schemaBindings>
</jaxb:bindings>

But no joy.

Trying to set on the individual xsd files in that namespace left me with the dread

[ERROR] Multiple <schemaBindings> are defined for the target namespace "http://www.openapplications.org/oagis/9"

Pointers/suggestions are appreciated.

È stato utile?

Soluzione

This is a bit hard to answer without seeing the whole compilation. However I often got this error when compiling third-party schemas in the case when the same schema was included via different URLs.

I.e. I've implemented a project which compiled an extensive set of OGC Schemas. The problem was that these schemas referenced each other via relative and absolute URLs. So when I customized one of the schemas there were other schemas for the same namespace URI. Since JAXB processes imports and includes, it is not quite transparent what exactly gets compiled. Try to check your XJC logs for cues or - if you compile schemas directly via URLs (which is not recommended) - go through a logging proxy and see what actually gets accessed.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top