经过一些试验和错误并基于此 xjb 绑定文件,此命令行将生成代码
xjc -d src -XautoNameResolution -b indoor.xjb -nv indoorgmlcore.xsd
没有使用包名称,-XautoNameResolution
添加并删除了一些扩展。文件中的注释xjb
表示添加到原始xjb
. 使用了最新版本的 xsd。
indoor.xjb
内容:
<jaxb:bindings version="1.0" xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
jaxb:extensionBindingPrefixes="xjc">
<!--
xmlns:wildcard="http://jaxb2-commons.dev.java.net/basic/wildcard"
xmlns:annox="http://annox.dev.java.net"
-->
<jaxb:bindings schemaLocation="http://schemas.opengis.net/gml/3.2.1/gml.xsd"
node="/xs:schema">
<jaxb:schemaBindings>
<jaxb:package name="net.opengis.gml.v_3_2"/>
</jaxb:schemaBindings>
</jaxb:bindings>
<jaxb:bindings schemaLocation="http://schemas.opengis.net/gml/3.2.1/geometryPrimitives.xsd" node="/xs:schema">
<jaxb:bindings>
<jaxb:bindings node="//xs:group[@name='PointGrid']/xs:sequence/xs:element[@name='rows']">
<!-- ** Backwards incompatible -->
<jaxb:property name="PointGridRows"/>
</jaxb:bindings>
</jaxb:bindings>
</jaxb:bindings>
<!-- StackOverflow 68692723 question -->
<jaxb:bindings schemaLocation="http://www.w3.org/1999/xlink.xsd" node="/xs:schema">
<jaxb:bindings>
<jaxb:bindings node="//xs:element[@name='title']">
<jaxb:property name="XTitle"/>
</jaxb:bindings>
</jaxb:bindings>
</jaxb:bindings>
<jaxb:bindings schemaLocation="http://schemas.opengis.net/gml/3.2.1/coordinateOperations.xsd">
<jaxb:bindings node="//xs:element[@name='parameterValue']">
<jaxb:factoryMethod name="xparameterValue"/>
</jaxb:bindings>
<jaxb:bindings node="//xs:element[@name='operationParameter']">
<jaxb:factoryMethod name="xoperationParameter"/>
</jaxb:bindings>
<jaxb:bindings node="//xs:element[@name='OperationParameter']">
<jaxb:factoryMethod name="XOperationParameter"/>
</jaxb:bindings>
</jaxb:bindings>
<!-- StackOverflow 68692723 question END -->
<jaxb:bindings schemaLocation="http://schemas.opengis.net/gml/3.2.1/grids.xsd" node="/xs:schema">
<jaxb:bindings>
<jaxb:bindings node="xs:complexType[@name='GridType']/xs:complexContent/xs:extension/xs:sequence/xs:choice/xs:element[@name='axisLabels']">
<!-- ** Backwards incompatible -->
<jaxb:property name="GridAxisLabels"/>
</jaxb:bindings>
</jaxb:bindings>
</jaxb:bindings>
<jaxb:bindings schemaLocation="http://schemas.opengis.net/gml/3.2.1/datums.xsd" node="/xs:schema">
<jaxb:bindings>
<jaxb:bindings node="//xs:element[@name='secondDefiningParameter']">
<jaxb:class name="SecondDefiningParameterPropertyElement"/>
</jaxb:bindings>
<jaxb:bindings node="//xs:element[@name='ellipsoid']">
<jaxb:factoryMethod name="EllipsoidPropertyElement"/>
</jaxb:bindings>
<jaxb:bindings node="//xs:element[@name='primeMeridian']">
<jaxb:factoryMethod name="PrimeMeridianPropertyElement"/>
</jaxb:bindings>
</jaxb:bindings>
</jaxb:bindings>
<jaxb:bindings schemaLocation="http://schemas.opengis.net/gml/3.2.1/coordinateReferenceSystems.xsd" node="/xs:schema">
<jaxb:bindings>
<jaxb:bindings node="//xs:element[@name='userDefinedCS']">
<jaxb:factoryMethod name="UserDefinedCSPropertyElement"/>
</jaxb:bindings>
<jaxb:bindings node="//xs:element[@name='cartesianCS']">
<jaxb:factoryMethod name="CartesianCSPropertyElement"/>
</jaxb:bindings>
<jaxb:bindings node="//xs:element[@name='sphericalCS']">
<jaxb:factoryMethod name="SphericalCSPropertyElement"/>
</jaxb:bindings>
<jaxb:bindings node="//xs:element[@name='polarCS']">
<jaxb:factoryMethod name="PolarCSPropertyElement"/>
</jaxb:bindings>
<jaxb:bindings node="//xs:element[@name='linearCS']">
<jaxb:factoryMethod name="LinearCSPropertyElement"/>
</jaxb:bindings>
<jaxb:bindings node="//xs:element[@name='verticalCS']">
<jaxb:factoryMethod name="VerticalCSPropertyElement"/>
</jaxb:bindings>
<jaxb:bindings node="//xs:element[@name='cylindricalCS']">
<jaxb:factoryMethod name="CylindricalCSPropertyElement"/>
</jaxb:bindings>
<jaxb:bindings node="//xs:element[@name='ellipsoidalCS']">
<jaxb:factoryMethod name="EllipsoidalCSPropertyElement"/>
</jaxb:bindings>
<jaxb:bindings node="//xs:element[@name='affineCS']">
<jaxb:factoryMethod name="AffineCSPropertyElement"/>
</jaxb:bindings>
<jaxb:bindings node="//xs:element[@name='timeCS']">
<jaxb:factoryMethod name="TimeCSPropertyElement"/>
</jaxb:bindings>
<jaxb:bindings node="//xs:element[@name='imageDatum']">
<jaxb:factoryMethod name="ImageDatumPropertyElement"/>
</jaxb:bindings>
<jaxb:bindings node="//xs:element[@name='geodeticDatum']">
<jaxb:factoryMethod name="GeodeticDatumPropertyElement"/>
</jaxb:bindings>
<jaxb:bindings node="//xs:element[@name='temporalDatum']">
<jaxb:factoryMethod name="TemporalDatumPropertyElement"/>
</jaxb:bindings>
<jaxb:bindings node="//xs:element[@name='engineeringDatum']">
<jaxb:factoryMethod name="EngineeringDatumPropertyElement"/>
</jaxb:bindings>
<jaxb:bindings node="//xs:element[@name='verticalDatum']">
<jaxb:factoryMethod name="VerticalDatumPropertyElement"/>
</jaxb:bindings>
<jaxb:bindings node="//xs:element[@name='conversion']">
<jaxb:factoryMethod name="ConversionPropertyElement"/>
</jaxb:bindings>
</jaxb:bindings>
</jaxb:bindings>
</jaxb:bindings>
基于此页面修复的错误如下
[错误] 两个声明导致 ObjectFactory 类中的冲突。http://schemas.opengis.net/gml/3.2.1/coordinateOperations.xsd的第 243 行