什么是生成多个XSD模式文件的C#类的最佳方法是什么?
What is the best way to generate C# classes from multiple XSD schema files?
有些XSD架构文件可能依赖于其他,我试图避免重复正在生成的C#类。
Some XSD schema files may have dependency to the other, I am trying to avoid duplicated C# classes being generated.
推荐答案使用的XSD.EXE方案,但通过的所有的的模式的。在同一命令行程序
Use the XSD.EXE program, but pass all of the schemas to the program on the same command line.
例如:
> xsd /c qbxmltypes130.xsd QBUqbxmlops130.xsd QBUqbxmlso130.xsd QBUqbxml130.xsd
会散发出一种名为类:
Will emit a class named:
qbxmltypes130_QBUqbxmlops130_QBUqbxmlso130_QBUqbxml130.cs在这种情况下,这些都是Quickbooks的桌面的SDK XSD文件,并最终文件具有类型这取决于在所述第一3个文件。它不会散发出自身,但其依赖它的工作原理根据需要
In this case these are Quickbooks Desktop SDK xsd files, and the final file has types it depends on in the first 3 files. It won't emit on its own, but with its dependencies it works as desired.
请注意,有一个 /参数:<文件> ; 开关,允许你指定的命令行参数的文件。我记得在一个类似的原因,一个项目使用它。
Note that there is a /parameters:<file> switch that allows you to specify a file of command line parameters. I remember using it in one project for a similar reason.
的 XSD.EXE 文档具有参数格式。
更多推荐
多个XSD模式文件到C#类
发布评论