Travis

Travis

  • NA
  • 2
  • 0

Not Quite sure what the issue is right now.

Nov 24 2009 11:20 PM
I get this Error when using the below Code:

Photobucket


XmlDocument xDoc = new XmlDocument();
                xDoc.Load(Assembly.GetExecutingAssembly().GetManifestResourceStream("UnnamedChaos_20.Data.MechList.xml")); //File is located in the "\bin\Debug" folder

                XmlNodeList name = xDoc.GetElementsByTagName("name");
                XmlNodeList type = xDoc.GetElementsByTagName("type");
                XmlNodeList id = xDoc.GetElementsByTagName("id");
                XmlNodeList icon = xDoc.GetElementsByTagName("icon");
                XmlNodeList weapon1 = xDoc.GetElementsByTagName("weapon1");
                XmlNodeList weapon2 = xDoc.GetElementsByTagName("weapon2");
                XmlNodeList weapon3 = xDoc.GetElementsByTagName("weapon3");
                XmlNodeList weapon4 = xDoc.GetElementsByTagName("weapon4");
                XmlNodeList ammo1 = xDoc.GetElementsByTagName("ammo1");
                XmlNodeList ammo2 = xDoc.GetElementsByTagName("ammo2");
                XmlNodeList ammo3 = xDoc.GetElementsByTagName("ammo3");
                XmlNodeList ammo4 = xDoc.GetElementsByTagName("ammo4");
                XmlNodeList head = xDoc.GetElementsByTagName("head");
                XmlNodeList cTorso = xDoc.GetElementsByTagName("cTorso");
                XmlNodeList rTorso = xDoc.GetElementsByTagName("rTorso");
                XmlNodeList lTorso = xDoc.GetElementsByTagName("lTorso");
                XmlNodeList rArm = xDoc.GetElementsByTagName("rArm");
                XmlNodeList lArm = xDoc.GetElementsByTagName("lArm");
                XmlNodeList rLeg = xDoc.GetElementsByTagName("rLeg");
                XmlNodeList lLeg = xDoc.GetElementsByTagName("lLeg");
                XmlNodeList walk = xDoc.GetElementsByTagName("walk");
                XmlNodeList run = xDoc.GetElementsByTagName("run");
                XmlNodeList jump = xDoc.GetElementsByTagName("jump");

                Mech[] mList = new Mech[name.Count];
                for (int x = 0; x < name.Count; x++)
                {

                    mList[x] = new Mech(name[x].Value.ToString(), Convert.ToInt32(type[x].Value), Convert.ToInt32(id[x].Value), icon[x].Value.ToString(), Convert.ToInt32(weapon1[x].Value), Convert.ToInt32(weapon2[x].Value), Convert.ToInt32(weapon3[x].Value),
                    Convert.ToInt32(weapon4[x].Value), Convert.ToInt32(ammo1[x].Value), Convert.ToInt32(ammo2[x].Value), Convert.ToInt32(ammo3[x].Value), Convert.ToInt32(ammo4[x].Value), Convert.ToInt32(head[x].Value), Convert.ToInt32(cTorso[x].Value), Convert.ToInt32(rTorso[x].Value), Convert.ToInt32(lTorso[x].Value),
                        Convert.ToInt32(rArm[x].Value), Convert.ToInt32(lArm[x].Value), Convert.ToInt32(rLeg[x].Value), Convert.ToInt32(lLeg[x].Value), Convert.ToInt32(walk[x].Value), Convert.ToInt32(run[x].Value), Convert.ToInt32(jump[x].Value));
                   
                   
                }

.::Edit::.
Value should be Innertext which makes it work...