How to do a xml parsing

ErdeZGZ

New Member
I have this xml file: http://www.studiovincent.net/list.xmlI need parser with c#, to get values. Im using this code:\[code\]XmlReader xmlReader = XmlReader.Create("http://www.studiovincent.net/list.xml"); while (xmlReader.Read()) { if ((xmlReader.NodeType == XmlNodeType.Element) && (xmlReader.Name == "field")) { if (xmlReader.HasAttributes) Console.WriteLine(xmlReader.GetAttribute("name") + ": " + xmlReader.GetAttribute("price")); } } Console.ReadKey();\[/code\]but I get in OUTPUT this result:\[code\]name:username:age:hair:name:username:age:hair:name:username:age:hair:\[/code\]How Can I get this result?\[code\]VincentHill31blackJohnTedelon27brownMichaelLopez20redFrankLopez25black\[/code\]and this result?\[code\] Vincent John Michael Frank\[/code\]Thanks in advance!
 
Back
Top