Jaxb equivalent in C#(C# 中的 Jaxb 等效项)
问题描述
在 Java 中使用 JAXB 很容易从 xml 模式文件生成一组 Java 类,符合该模式的 xml 可以反序列化为.
Using JAXB in Java it is easy to generate from a xml schema file a set of Java classes that xml conforming to that schema can be deserialized to.
是否有一些 C# 等效于 JAXB?我知道 Linq 可以序列化和反序列化与 xml 文件之间的类.但是如何从 xml 模式文件生成 C# 类,然后将这些类与 linq 一起使用?
Is there some C# equivalent of JAXB? I know that Linq can serialize and deserialize classes to/from xml files. But how can I generate C# classes from xml schema file and then use this classes with linq?
推荐答案
如果您使用的是 Visual Studio, 试试 XML 架构定义工具.它采用您的模式定义并生成 C# 类——或者它可以采用另一种方式并从类中生成模式定义.它还有许多其他与 XML 相关的转换.
If you're using Visual Studio, try the XML Schema Definition Tool. It takes your schema definitions and produces C# classes -- or it can go the other way and produce schema definitions from classes. It also has a number of other XML-related transformations.
这篇关于C# 中的 Jaxb 等效项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:C# 中的 Jaxb 等效项


基础教程推荐
- 将 Office 安装到 Windows 容器 (servercore:ltsc2019) 失败,错误代码为 17002 2022-01-01
- MS Visual Studio .NET 的替代品 2022-01-01
- 如何激活MC67中的红灯 2022-01-01
- 将 XML 转换为通用列表 2022-01-01
- 有没有办法忽略 2GB 文件上传的 maxRequestLength 限制? 2022-01-01
- 如何在 IDE 中获取 Xamarin Studio C# 输出? 2022-01-01
- c# Math.Sqrt 实现 2022-01-01
- 为什么Flurl.Http DownloadFileAsync/Http客户端GetAsync需要 2022-09-30
- SSE 浮点算术是否可重现? 2022-01-01
- rabbitmq 的 REST API 2022-01-01