多个XSD模式文件到C#类

编程入门 行业动态 更新时间:2024-10-25 06:29:11
本文介绍了多个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#类

本文发布于:2023-11-09 05:28:55,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1571508.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:多个   模式   文件   XSD

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!