1. Create a complextype.xsd file under the D:/xml practice directory
<?xml version= "1.0" encoding= "UTF-8"? ><xs:schema xmlns:xs= "Http://www.w3.org/2001/XMLSchema" xmlns: ts= "http://my.soa.complexType.com/complexTypexsd" targetnamespace= "http://my.soa.complexType.com/complexTypexsd "elementformdefault=" qualified "><xs:element name=" Catalog "><xs:complexType><xs:sequence> <xs:element maxoccurs= "unbounded" ref= "Ts:book"/></XS:SEQUENCE></XS:COMPLEXTYPE></XS: Element><xs:element name= "book" ><xs:complextype><xs:sequence><xs:element name= "name" type = "Xs:string"/><xs:element name= "title" Type= "xs:string"/><xs:element name= "Price" type= "Xs:decimal"/ ></xs:sequence></xs:complexType></xs:element></xs:schema>
2. Download the XJC tool, which can be downloaded at the following link:
http://download.csdn.net/detail/u013998070/8569667
3. Open the command line and adjust to the bin directory of the XJC Toolkit
If you do not know what you need to enter, you can simply enter the XJC command to view it, as follows
After you clear the relevant commands, enter the following instructions to generate the target Java code
The schema that owns the complextype generates Java code