如何从XML模式创建动态对象 [英] How to create dynamic object from XML Schema
本文介绍了如何从XML模式创建动态对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想使用c#编码基于传递的xml模式创建新对象.
有可能吗?
我们如何创建对象?
谢谢
Saka
I want to create new object based on passed xml schema using c# coding.
Is it possible?
How can we create an object?
Thanks
Saka
推荐答案
成员2509982写道:
Member 2509982 wrote:
我们如何创建对象?
通过调用它的构造函数.如果您使用XML格式的数据,则可以读取传递给构造函数所需的值.
By calling it''s constructor. If you have the data in XML, you can read the values you need to pass to the constructor.
您必须a)知道架构的组织/内容,b)手动创建一个反映该架构的对象.此时,您可以将XML反序列化为对象的实例.
编辑==========
您还可以从xml创建数据集.
You have to a) know the organization/contents of the schema, and b) manually create an object that reflects that schema. At that point, you can deserialize the XML into an instance of object.
EDIT ==========
You could also create a dataset from xml.
HI,
我想基于XML Schema定义创建对象.
我们如何创建此动态对象?
谢谢
萨卡(Saka)
I want to create a object based on XML Schema definition.
How can we create this dynamic object?
Thanks
Saka
这篇关于如何从XML模式创建动态对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文