多个XSD模式文件到C#类 [英] Multiple XSD schema files to C# classes

查看:100
本文介绍了多个XSD模式文件到C#类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是生成多个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#类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆