将xml字符串转换为实体类对象将xml字符串转换为实体类对象 [英] Convert xml string to entities class object convert xml string to entities class object

查看:583
本文介绍了将xml字符串转换为实体类对象将xml字符串转换为实体类对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好我有一个字符串=

Hi i have one string =

<CASES TOTAL="16">
<CASE INDEX="1">
<ID>11</ID>
<CaseNotes/>
<TrailNumber>1</TrailNumber>
<OpenDate>09-03-2012 00:00:00</OpenDate>
<CourtName>New York SupremeCourt</CourtName>
<CourtLocation>Rockland</CourtLocation>
<Trialdate/><IndDock/>
<Part>1</Part>
<Active/>
<Dominant>T</Dominant>
<MatterType/><Calendar/>
<IndexNumber>85/10</IndexNumber>
<FileNumber/>
<ClMatNumber/><MatterNumber/>
<MatterCloseDate/>
<MatterTrailLabel/>
<Other/>
<MT_CP_ID/>
<User1/>
<User2/>
<User3/>
<DomJudge/>
<CurrMatStatAbbribute/>
<Search>T</Search>
<CaseLocation/>
<ShortCaption/>
<FullCaption>EMILY BRONTE v. GEORGE ELLIOT</FullCaption>
<MatterName/>
<ClientID/>
<MotionTrack/>
<Selected/>
<Deleted/>
<IsAlert>False</IsAlert>
<LastSearchedDate>10-02-2016 03:52:32</LastSearchedDate>
<OfficeID/>
<JurisdictionID>58</JurisdictionID>
<CalendarRulesSetsID>99</CalendarRulesSetsID>
</CASES>



OF xml文件现在我想要在类实体中转换字符串


OF xml FILE SO NOW I WANT TO CONVERT THAT string in class entities

public class CaseList
    {
        public int CaseIndex { get; set; }
        public int ID { get; set; }
        public int MTTrailNum { get; set; }
        public string CaseStatus { get; set; }
        public int TrailNumber{get;set;}
        public DateTime? OpenDate{get;set;}
        public string CourtName {get;set;} 
        public string CourtLocation{set;get;}
        public DateTime? Trialdate{set;get;}
        public int Part{get;set;}
        public string Active{set;get;}
        public  string Dominant{get;set;}
        public string MatterType{get;set; }
        public string   IndexNumber { get; set; }
        public  string  FileNumber{get;set;}
        public  string  ClMatNumber{get;set;}
        public  string  MatterNumber{get;set;}
        public  DateTime?  MatterCloseDate{get;set;}
        public  string  MatterTrailLabel{get;set;}
        public  string  Other{get;set;}
        public  string  MTCPID{get;set;}
        public  string  User1{get;set;}
        public  string  User2{get;set;}
        public  string  User3{get;set;}
        public  string  DomJudge{get;set;}
        public  string  Search{get;set;}
        public  string  CaseLocation{get;set;}
        public  string  ShortCaption{get;set;}
        public  string  FullCaption{get;set;}
        public  string  MatterName{get;set;}
        public  int  ClientID{get;set;}
        public  string  MotionTrack{get;set;}
        public  string  Selected{get;set;}
        public  string  Deleted{get;set;}
        public  int  OfficeID{get;set;}
        public  string  JurisdictionID{get;set;}
        public  string  CalendarRulesSetsID{get;set;}
        public bool IsAlert { get; set; }
        public DateTime? LastSearchedDate { get; set; }
    }



所以pl建议我如何在类对象中转换这个字符串



< b>我尝试了什么:



i尝试使用xml序列化,但它没有用,所以任何一些建议或代码引用相同的


so pl suggest me how to convert this string in class object

What I have tried:

i have tried using xml serializing but it didnt work so can any some suggest or code reference for same

推荐答案

如果我理解你,你想要反序列化数据。



请按照以下链接:

如何使用Visual C#将对象序列化为XML [ ^ ]

XML序列化示例 [ ^ ]

XML序列化和反序列化:第1部分 [ ^ ]

C#中的XML序列化和反序列化 [ ^ ]



试试!
If i understand you well, you want to deserialize data.

Please, follow these links:
How to serialize an object to XML by using Visual C#[^]
Examples of XML Serialization[^]
XML Serialization and Deserialization: Part-1[^]
XML Serialization and Deserialization in C#[^]

Try!


这篇关于将xml字符串转换为实体类对象将xml字符串转换为实体类对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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