I'm trying to create a ticket system with XML in C#, but for some reason the values keep returning null. The Id Attribute is not null when getting it.
This is my loading method:
XmlDocument doc = new XmlDocument();
doc.Load("ticketdata.xml");
foreach (XmlNode node in doc.DocumentElement) {
int id = int.Parse(node.Attributes[0].Value);
string user = node["user"].Value;
string platform = node["platform"].Value;
string ttext = node["ttext"].Value;
tickets.Add(new Ticket(id, user, platform, ttext));
}
This is my XML file:
XML File ( for some reason XML didn't work great in text)
I hope you guys could help me with this.