自定义xs:## any JAXB映射以摆脱org.w3c.dom.Element

时间:2019-02-25 13:02:36

标签: jaxb

XJC确实将架构中的xs:## any绑定到org.w3c.dom.Element。可以对此进行自定义并将xs:any绑定到例如java.lang.Object?

XSD

<jxb:bindings node="//xs:complexType[@name='Data']">
            <jxb:bindings node="xs:sequence">
                <jxb:bindings node="xs:any">
                    <jxb:javaType name="java.lang.Object"/>
                </jxb:bindings>
            </jxb:bindings>
</jxb:bindings>

绑定(无效)

<jxb:bindings node="//xs:complexType[@name='Data']/xs:sequence/xs:any">
            <jxb:property>
                <jxb:baseType name="java.lang.Object" />
            </jxb:property>
        </jxb:bindings>

0 个答案:

没有答案