Feb 07, 2013 11:04 AM|BBird40|LINK
Sorry about the late reply Kushalrdalal. For some reason, I am not getting emails about replies.
So I am reading the xml file fine now. Now I have to create my own XML from this XML. Essentially, I am only pulling out data that I need to create a new XML file.
I am experiencing a weird issue now though.
Here is a snippet of what I am trying to do:
Schedule showsForDay = new Schedule();
IEnumerable<XElement> performancesPerShow = from XElement ppf in show.Descendants("performance") select ppf; //obtain each performance for the selected show
foreach (XElement performance in performancesPerShow)//for each performance obtained in the LINQ query above
showPerformances = new Performance(Convert.ToInt32(film.Attribute("code").Value.ToString()), shows, roomLocations);
All in all, the Schedule class is a List of Performances (aka List<Perfomances>). So, if I leave my code like it is the lists -- shows and roomLocations -- will contain old data from a previous performance. This will create false data within the new XML
I have to create. As a result, I tried to use the Clear() method of List after I add the performance object to showsForDay. However, when I do this it clears all of my list data in showsForDay. I have some more ideas that I am going to try but you all may
know what mistake I am making.