I'm trying to parse my XML in C#.
Here's part of the file that is relevant:
<holder name="wnd_login" width="300" x="20" height="180">...</holder>
Here's the code that is supposed to read it:
while (reader.Read())
{
if (reader.IsStartElement())
{
switch (reader.Name)
{
case "holder":
Holder holder = new Holder(reader.GetAttribute("name"));
...
}
}
}
I read around that the common mistake was to forget a check to see if the element was a start element. I added it but the GetAttribute still returns null. Any idea?