JAXB相当于在C# [英] Jaxb equivalent in C#
问题描述
使用JAXB在Java中,很容易从一个XML schema文件生成一组XML符合该模式的Java类,可以将反序列化。
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.
这篇关于JAXB相当于在C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!