的意义是什么

时间:2010-12-29 08:44:25

标签: jaxb xjc

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

1 个答案:

答案 0 :(得分:3)

如果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