【发布时间】:2016-06-21 17:54:59
【问题描述】:
所以我已经为 waterml2.xsd 编写了一个外部绑定文件,并且到目前为止已经修复了 [Error] 属性“Rows”已定义并且 [Error] 属性“Title”已定义。
修复这些问题后,我现在遇到了多个处理碰撞的问题。例如:
[错误] 同名的类/接口 “net.opengis.gml._3.SecondDefiningParameter”已在使用中。用一个 类自定义来解决这个冲突。
[错误] 两个声明导致 ObjectFactory 类发生冲突。
这是绑定文件的样子:
<bindings xmlns="http://java.sun.com/xml/ns/jaxb" xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0">
<!-- In geometryPrimitives.xsd, fix so element and attribute both with name "rows" don't conflict -->
<bindings schemaLocation="http://schemas.opengis.net/gml/3.2.1/geometryPrimitives.xsd" version="3.2.1.2">
<bindings node="//xs:group/xs:sequence/xs:element[@name='rows']">
<property name="rowsElement"/>
</bindings>
</bindings>
<!-- In xlink.xsd, fix so element and attributes don't have the same "titles" conflict -->
<bindings schemaLocation="http://www.w3.org/1999/xlink.xsd" node="/xs:schema">
<schemaBindings>
<package name="net.opengis.wfs._2_1"/>
</schemaBindings>
</bindings>
<bindings schemaLocation="http://www.w3.org/1999/xlink.xsd" node="/xs:schema">
<bindings node="//xs:attributeGroup[@name='locatorAttrs']">
<bindings node=".//xs:attribute[@ref='xlink:title']">
<property name="LocatorAttrsTitle"/>
</bindings>
</bindings>
<bindings node="//xs:group[@name='locatorModel']">
<bindings node=".//xs:element[@ref='xlink:title']">
<property name="LocatorModelTitle"/>
</bindings>
</bindings>
<bindings node="//xs:attributeGroup[@name='arcAttrs']">
<bindings node=".//xs:attribute[@ref='xlink:title']">
<property name="ArcAttrsTitle"/>
</bindings>
</bindings>
<bindings node="//xs:group[@name='arcModel']">
<bindings node=".//xs:element[@ref='xlink:title']">
<property name="ArcModelTitle"/>
</bindings>
</bindings>
</bindings>
</bindings>
如果有人有任何建议或处理过 WaterML 2.0 架构,我将不胜感激!谢谢。
【问题讨论】:
标签: java binding jaxb external