# HG changeset patch # User IBBoard # Date 1238613627 0 # Node ID 1b35eed503efb48d0ce3cd1fdbe43e447f49eb38 # Parent 64ef178c18aa0766323fa25d60ace83b072c8e7f Closes #13 - Migrate to XPath * Remove elem.ChildNodes calls and use XPath to make sure we're getting the nodes we think we should diff -r 64ef178c18aa -r 1b35eed503ef api/Factories/Xml/WarFoundryXmlGameSystemFactory.cs --- a/api/Factories/Xml/WarFoundryXmlGameSystemFactory.cs Mon Mar 30 19:44:03 2009 +0000 +++ b/api/Factories/Xml/WarFoundryXmlGameSystemFactory.cs Wed Apr 01 19:20:27 2009 +0000 @@ -89,7 +89,7 @@ List slots = new List(); string id = elem.GetAttribute("id"); - foreach (XmlElement slot in elem.ChildNodes) + foreach (XmlElement slot in WarFoundryXmlFactoryUtils.SelectNodes(elem, "system:sysStat")) { StatSlot statSlot = new StatSlot(slot.GetAttribute("name")); slots.Add(statSlot); diff -r 64ef178c18aa -r 1b35eed503ef api/Factories/Xml/WarFoundryXmlRaceFactory.cs --- a/api/Factories/Xml/WarFoundryXmlRaceFactory.cs Mon Mar 30 19:44:03 2009 +0000 +++ b/api/Factories/Xml/WarFoundryXmlRaceFactory.cs Wed Apr 01 19:20:27 2009 +0000 @@ -131,7 +131,7 @@ Stats stats = new Stats(statsSet); - foreach (XmlElement stat in elem.ChildNodes) + foreach (XmlElement stat in WarFoundryXmlFactoryUtils.SelectNodes(elem, "race:stat")) { String statID = stat.GetAttribute("name"); StatSlot slot = statsSet[statID];