Xml反序列化问题 [英] Xml Deserialization problem

查看:62
本文介绍了Xml反序列化问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


大家好,



我试图反序列化以下结构我遇到了一些问题。



< p align = left><回复>
<结果>成功< /结果>
<回复>
<数据>
< dataItem main =" waiting"> < br>< Item> Text0< / Item>
< / dataItem>
< dataItem main =" Fancy">
< Item> Text1< / Item>
<项目> Text2< / Item>
< / dataItem>
< / data>
< Xml>



< Data> ;< /数据与GT;结果<日期和GT;< /日期和GT;结果<输入>< /回车>结果<退出>< /退出>结果<性状> < br>< prop1>< / prop1>
< prop2>< / prop2>
< / properties>



< / Xml>
< / Response>
<回复>




在上面的xml结构中,我需要中间的数据< Xml>节点作为xmldocument,即我希望数据不应该序列化我想要那些节点,因为它是xml。我使用属性为结构编写了类,根据xmlstructure我可以使用这些属性获取对象。但是对于那个类我无法获得结构n可能我不知道那个。可以任何人帮助我解决这个问题。



先谢谢,


Rajak Shaik。

解决方案

嗨Rajak,


       试试这个帖子 - http://social.msdn。 microsoft.com/Forums/en-US/csharpgeneral/thread/aa1263d0-57ac-42ee-9097-6e11d97c9a73


 

Hi All,

 

    Im trying to deserialize the following structure n im getting some problem.

 

<Responses>
<Result>Success</Result>
<Response>
<data>
<dataItem main="waiting">
<Item>Text0</Item>
</dataItem>
<dataItem main="Fancy">
<Item>Text1</Item>
<Item>Text2</Item>
</dataItem>
</data>
<Xml>


<Data></Data>
<Date></Date>
<Enter></Enter>
<Exit></Exit>
<properties>
  <prop1></prop1>
  <prop2></prop2>
</properties>


</Xml>
</Response>
<Responses>

 

 

           Here in the above xml structure i need the data inbetween <Xml> nodes as a xmldocument, i.e. i want that data should not be serialized n i want those nodes as it is as the xml. I wrote the class for the structure using properties that with which im getting an object according to that xmlstructure. But with that class im not able to get the structure n may be im not aware of that one. Can Any one plz help me out to solve this problem.

 

Thanks in Advance,

Rajak Shaik.

解决方案

Hi Rajak,

        Try This Post-http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/aa1263d0-57ac-42ee-9097-6e11d97c9a73


这篇关于Xml反序列化问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆