介绍二种方式.
1, tang.jar
下载jar: http://www.mvnrepository.com/artifact/com.thaiopensource/trang/20091111
使用命令: java -jar trang.jar person.xml person.xsd
2, 利用Vistual Studio自带的xsd.exe工具
我电脑Win10, 它的目录是C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bin
1), 将Xml文件拷贝到xsd.exe工具所在的文件夹,生成的xsd文件也将在这个文件夹中
2), 在命令提示符中输入 xsd.exe test1.xml, 多个xml文件以空格隔开