0

假设这一点——我想以预定义的方案读写 XML——直到现在还可以。

问题是开发人员需要执行明确的操作,以防他想要添加另一个属性(例如 xsd.exe),这在源代码控制方面非常令人沮丧(需要签出、生成新文件并签入) )。

有没有办法仅通过提供其 XSD 来读取 xml(无需为此实际自动生成一个类?) - 在这种情况下,如果新字段将引入 - 开发人员将只更改 XSD 或其他东西?

4

1 回答 1

0

Please check the below link,

This can be the solution for this problem.

But please keep in mind that using xsd.exe is robust way to generate the classes for schema.

You can generate the class code form xsd on the fly and you can compile the code and use in your application

How to programmaticly generate .NET classes from XSD? (Like xsd.exe do)

http://msdn.microsoft.com/en-us/library/system.xml.serialization.xmlcodeexporter

http://msdn.microsoft.com/en-us/library/650ax5cx.aspx

于 2012-11-11T20:04:52.507 回答