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