Java 用于OGC模式的Jaxb
这是我的方案(scheme1.xsd) 我明白了:Java 用于OGC模式的Jaxb,java,jaxb,ogc,Java,Jaxb,Ogc,这是我的方案(scheme1.xsd) 我明白了: parsing a schema... [ERROR] Property "Title" is already defined. Use <jaxb:property> to resolve this conflict. line 232 of "http://www.w3.org/1999/xlink.xsd" [ERROR] The following location is relevant to the above
parsing a schema...
[ERROR] Property "Title" is already defined. Use <jaxb:property> to resolve this conflict.
line 232 of "http://www.w3.org/1999/xlink.xsd"
[ERROR] The following location is relevant to the above error
line 219 of "http://www.w3.org/1999/xlink.xsd"
[ERROR] Property "Title" is already defined. Use <jaxb:property> to resolve this conflict.
line 261 of "http://www.w3.org/1999/xlink.xsd"
[ERROR] The following location is relevant to the above error
line 246 of "http://www.w3.org/1999/xlink.xsd"
Failed to parse a schema.
我使用了这个文件(binding.xjb):
我做错了什么?问题是xjc构建的ObjectFactory将包含一个用于包内元素的factory方法,在您的情况下: 在geometryPrimitives.xsd的第1466行:
<element name="_Solid" type="gml:AbstractSolidType" abstract="true" ...
parsing a schema...
[ERROR] Property "Title" is already defined. Use <jaxb:property> to resolve this conflict.
line 232 of "http://www.w3.org/1999/xlink.xsd"
[ERROR] The following location is relevant to the above error
line 219 of "http://www.w3.org/1999/xlink.xsd"
[ERROR] Property "Title" is already defined. Use <jaxb:property> to resolve this conflict.
line 261 of "http://www.w3.org/1999/xlink.xsd"
[ERROR] The following location is relevant to the above error
line 246 of "http://www.w3.org/1999/xlink.xsd"
Failed to parse a schema.
<jxb:bindings version="2.0"
xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
xmlns:xs="http://www.w3.org/2001/XMLSchema" >
<jxb:bindings schemaLocation="http://www.w3.org/1999/xlink.xsd" node="/xs:schema">
<jxb:bindings node="//xs:attributeGroup[@name='locatorAttrs']">
<jxb:bindings node=".//xs:attribute[@ref='xlink:title']">
<jxb:property name="title1"/>
</jxb:bindings>
</jxb:bindings>
<jxb:bindings node="//xs:attributeGroup[@name='arcAttrs']">
<jxb:bindings node=".//xs:attribute[@ref='xlink:title']">
<jxb:property name="title2"/>
</jxb:bindings>
</jxb:bindings>
</jxb:bindings>
</jxb:bindings>
xjc scheme1.xsd -b binding.xjb
parsing a schema...
compiling a schema...
[ERROR] Two declarations cause a collision in the ObjectFactory class.
line 1466 of http://schemas.opengis.net/gml/3.1.1/base/geometryPrimitives.xsd
[ERROR] (Related to above error) This is the other declaration.
line 1520 of "http://schemas.opengis.net/gml/3.1.1/base/geometryPrimitives.xsd"
[ERROR] Two declarations cause a collision in the ObjectFactory class.
line 206 of "http://schemas.opengis.net/gml/3.1.1/base/defaultStyle.xsd"
[ERROR] (Related to above error) This is the other declaration.
line 225 of "http://schemas.opengis.net/gml/3.1.1/base/defaultStyle.xsd"
[ERROR] Two declarations cause a collision in the ObjectFactory class.
line 287 of "http://schemas.opengis.net/gml/3.1.1/base/geometryBasic0d1d.xsd"
<element name="_Solid" type="gml:AbstractSolidType" abstract="true" ...
<element name="Solid" type="gml:SolidType" substitutionGroup="gml:_Solid"/>
<jxb:bindings schemaLocation="http://schemas.opengis.net/gml/3.1.1/base/geometryPrimitives.xsd" node="/xs:schema">
<jxb:bindings node="//xs:element[@name='_Solid']">
<jxb:factoryMethod name="gmlAbstractSolidElementFactory" />
</jxb:bindings>
</jxb:bindings>
<bindings schemaLocation="../path/to/my.xsd">
<schemaBindings>
<package name="org.acme.foo"/>
</schemaBindings>
</bindings>