Make sure you have a jaxb binding file which looks like
<jaxb:bindings xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" jaxb:version="2.0" xmlns:xjc= "http://java.sun.com/xml/ns/jaxb/xjc" jaxb:extensionBindingPrefixes="xjc">
<jaxb:globalBindings>
<xjc:simple/>
</jaxb:globalBindings>
</jaxb:bindings>
In your xsd define your element like:
<xs:complexType name="FenceDefinition">
..
</xs:complexType>
<xs:element name="artifact" type="FenceDefinition"/>
Run the xjc compiler:
xjc -p <package-name> -xmlschema -d <gen-directory> -verbose -b jaxb.binding -extension <xsd-file>
No comments:
Post a Comment