Click here to Skip to main content
15,791,934 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi i have one string =
C#
<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 FILE SO NOW I WANT TO CONVERT THAT string in class entities
C#
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; }
    }

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
Posted
Updated 3-Mar-16 12:05pm
v2
Comments
F-ES Sitecore 26-Feb-16 5:15am    
You can't use serialisation as there is no mapping between your xml and the class. use XmlDocument to read the XML then simply create an instance of your class, read the properties from the XmlDocument using SelectNode and populate the relevant properties of your class.

1 solution

 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900