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 等效项


基础教程推荐
- C# 9 新特性——record的相关总结 2023-04-03
- 从 C# 控制相机设备 2022-01-01
- 将数据集转换为列表 2022-01-01
- 获取C#保存对话框的文件路径 2022-01-01
- 重新排序 WPF TabControl 中的选项卡 2022-01-01
- 在 VB6 或经典 ASP 中使用 .NET 2022-01-01
- 如果条件可以为空 2022-01-01
- 更新 Visual Studio 中的 DataSet 结构以匹配新的 SQL 数据库结构 2022-01-01
- Mono https webrequest 失败并显示“身份验证或解密失败" 2022-01-01
- SonarQube C# 分析失败“不是指针的有效行偏移" 2022-01-01