Xjc将xs中的任何类型绑定到org.w3c.dom.Element。 如果我想将此绑定自定义为groovy.util.Node,我该怎么做?
XSD:
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="datatype:v1"
elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:complexType name="ProgramDataType">
<xs:sequence>
<xs:any processContents="lax"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
结合:
<jxb:bindings version="1.0" xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc" jxb:extensionBindingPrefixes="xjc" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<jxb:bindings schemaLocation="datatype.xsd" node="//xs:complexType[@name='ProgramDataType']//xs:any">
<jxb:baseType name="groovy.util.Node"/>
</jxb:bindings>
</jxb:bindings>