c# working with xml צריך עזרה :/

xwar1

New member
c# working with xml צריך עזרה :/

טוב אז יש לי את http://lsirwww.epfl.ch/courses/cis/2005ss/exercises/1/bank.xml[/font][/URL] אני מצליח להעביר אותו לאוביקת של xmldocument ועכשיו אני צריך " your final task is to loop through its nodes and write out for each node, the name, the value and attributes (if exists). " ואני ממש לא יודע אך לעשות את זה כל החיפושים שלי ב google נותנים דוגמאות של root+child וכאן יש לי bank/accounts/savings_accounts צריך עזרה אך עושים את זה??
XmlDocument newdoc = new XmlDocument(); WebRequest request = WebRequest.Create("http://lsirwww.epfl.ch/courses/cis/2005ss/exercises/1/bank.xml"); request.Credentials = CredentialCache.DefaultCredentials; HttpWebResponse response = (HttpWebResponse)request.GetResponse(); Console.WriteLine(response.StatusDescription); Stream dataStream = response.GetResponseStream(); newdoc.Load(dataStream); XmlElement root = newdoc.DocumentElement; XmlNodeList nodes = root.SelectNodes("/bank"); foreach (XmlNode node in nodes) { string name = root.GetAttribute("customer_account c_id"); string name2 = node["customer_account c_id"].InnerText; string title = node["savings_accounts"].InnerText; // Do whatever you want Console.Write(name); }​
 
למעלה