如何建立从XML .xsd文件?文件、XML、xsd

2023-09-03 22:42:35 作者:别缺席我的未来

有没有一种方法来生成一个XML文件的XSD?是否有任何这样做的类文件?我不介意的解决办法是C#或Java。

Is there a way to generate an xsd from an xml file? Are there any class files that do this? I don't mind if the solution is c# or java.

我想为此在code,但如果有什么好的免费的工具,将是确定了。

I would like to do this in code, but if there are any good free tools that would be ok too.

感谢

推荐答案

XSD.EXE 可以做你想做的:

xsd.exe can do what you want:

如果您指定XML文件(.xml扩展名),XSD.EXE推断从文件中的数据的模式,并产生一个XSD架构。输出文件具有相同的名称为XML文件,但与扩展名为.xsd。

If you specify an XML file (.xml extension), Xsd.exe infers a schema from the data in the file and produces an XSD schema. The output file has the same name as the XML file, but with the .xsd extension.