Click here to Skip to main content
15,035,685 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I have to parse the data from a very big xml file with lot of repeatetive elements and child nodes. I could have used the GetElementsbyTagName but that will be a very lengthy and complex solution w.r.t this xml file.
I think the best method would be xml serialization and deserialization technique but i am a novice in it. Could anyone help me with this, please?

Currently what i have done is I have converted the XML file to CS file using XSD.exe.
Now this CS file consists of all the nodes & elements in form of different classes and objects.
C#
 public partial class ATX
 {
     private string cATEGORYField;
     private ATXADMINDATA aDMINDATAField;
     private ATXPROJECTDATA pROJECTDATAField;
     private ATXARPACKAGE[] aRPACKAGESField;
}


I am able to store the data in all the other objects except "private ATXARPACKAGE[] aRPACKAGESField". I believe this array of classes is created because of repeatetive nodes. Now if i want to save anything in this object "aRPACKAGESField", how can i do it? How to use/access "private ATXARPACKAGE[] aRPACKAGESField"
Posted
Updated 28-Apr-15 23:09pm
v2

Basically take a look at this answer:

Use XML reader instead of XML dom. XML dom stores the whole file in memory which is totally useless:

XmlReader Class

Your second question:
Quote:
How to use/access "private ATXARPACKAGE[] aRPACKAGESField"


Why have you made this variable private? Either you need a public property for it or (simply) let it be public.
   
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