且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用xsd.exe生成C#文件,获取错误和警告

更新时间:2022-06-06 01:59:32

您链接的PDF文档中包含的XML Schema使用< import> 元素引用了其他几个XSD文件.您将需要下载这些其他模式文件,并确保< import> 元素中的路径引用指向本地计算机上的正确位置.

The XML Schema included in the PDF document you linked has references to several other XSD files using the <import> element. You will need to download these additional schema files and make sure that the path references in the <import> elements are pointing to the correct locations on your local computer.

如果仍然出现错误,则是因为xsd.exe无法跟进外部引用.要解决此问题,请直接在命令行上指定所有必需的XSD文件,如下所示:

If you are still getting errors, it is because xsd.exe could not follow up on external references. To solve this issue, specify all the required XSD files directly on the command line as follows:

xsd.exe/c MySchema.xsd Import01.xsd Import02.xsd Include01.xsd Include02.xsd

其中Import01.xsd,Import02.xsd,Include01.xsd和Include02.xsd是通过import引用的XSD文件,并且包含MySchema.xsd中的元素.

where Import01.xsd, Import02.xsd, Include01.xsd and Include02.xsd are XSD files referenced via import and include elements in MySchema.xsd.