可以将globalBinding标记包含在根元素中吗?

时间:2011-01-05 10:20:11

标签: java xml xsd jaxb

我有以下外部绑定文件 -

<jxb:bindings version="1.0"
xmlns:jxb="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"
jxb:extensionBindingPrefixes="xjc"
>
<jxb:bindings schemaLocation="xyz" node="/xs:schema">
<jxb:globalBindings>
<xjc:serializable/>
</jxb:globalBindings>
<jxb:schemaBindings>
<jxb:package name="abc"/>
</jxb:schemaBindings>
</jxb:bindings>
</jxb:bindings>

我需要在根jxb:bindings

中放置jxb:globalBindings标记

1 个答案:

答案 0 :(得分:1)

是的,这是正确的地方

a <bindings> element can contain arbitrary number of binding declarations or nested <bindings> elements

http://java.sun.com/xml/ns/jaxb/bindingschema_1_0.xsd