Hi,
Well, first, this is not valid XML as it has multiple root elements. It
should be something like this instead
<?xml version="1.0" encoding="utf-8"?>
<Employees>
<Employee name="john" />
<Employee name="peter" />
<Employee name="mark" />
</Employees>
You can then load it into an XmlDocument and use SelectNodes to grab the
Employees, and then read the name attribute
XmlDocument doc = new XmlDocument();
doc.Load(@"C:\Employees.xml");
XmlNodeList elements = doc.SelectNodes("Employees/Employee");
ArrayList list = new ArrayList();
foreach (XmlNode node in elements)
list.Add(node.Attributes["name"].Value);
On Wed, 30 Aug 2006 08:29:39 +0200, <di***********@gmail.comwrote:
Hi All,
I have an xml file containing the following:
<?xml version="1.0" encoding="utf-8"?>
<Employee name="john" />
<Employee name="peter" />
<Employee name="mark" />
Can anyone let me know of away to read values from the xml file and add
them to an arraylist...
Thanks!
--
Happy Coding!
Morten Wennevik [C# MVP]