6

版本属性的允许值是jxb:bindings多少?

<jxb:bindings version="2.0"
              xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
              xmlns:xsd="http://www.w3.org/2001/XMLSchema">

我尝试对 xjc "2.2.3-hudson-jaxb-ri-2.2-70-" 使用不同的值

<jxb:bindings version="2.2"   ... xjc outputs ERROR, only "1.0" is allowed
<jxb:bindings version="2.1"   ... xjc compiled successfully
<jxb:bindings version="2.0"   ... xjc compiled successfully
<jxb:bindings version="1.0"   ... xjc compiled successfully

如果 JAXB 规范的版本之间的绑定发生变化,则使用 version 属性。在使用较新的 JAXB 实现时,这是确保向后兼容性所必需的。有关更多信息,请参阅 JAXB 2.1 规范的第 7.1.4 节。

指定版本 2.2 时收到的错误消息我认为是 XJC 错误:

<jxb:bindings version="2.2"   ... xjc outputs ERROR, only "1.0" is allowed
4

1 回答 1

4

如果 JAXB 规范的版本之间的绑定发生变化,则使用 version 属性。在使用较新的 JAXB 实现时,这是确保向后兼容性所必需的。有关更多信息,请参阅 JAXB 2.1 规范的第 7.1.4 节。

指定版本 2.2 时收到的错误消息我认为是 XJC 错误:

<jxb:bindings version="2.2"   ... xjc outputs ERROR, only "1.0" is allowed
于 2011-01-05T16:35:56.960 回答