---
title: "根据XML生成xsd"
author: "ldaolong"
date: "2018-01-31T09:24:48Z"
tags: []
categories: ["非技术"]
slug: "xml-xsd"
draft: false
lastmod: "2018-01-31T09:25:22Z"
id: 2409823
url: "https://ldaolong.iteye.com/blog/2409823"
---

介绍二种方式.

   **1, tang.jar**

    下载jar: [http://www.mvnrepository.com/artifact/com.thaiopensource/trang/20091111](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文件以空格隔开