Mercurial > repos > snowblizz-super-API-ideas
changeset 53:1b35eed503ef
Closes #13 - Migrate to XPath
* Remove elem.ChildNodes calls and use XPath to make sure we're getting the nodes we think we should
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Wed, 01 Apr 2009 19:20:27 +0000 |
parents | 64ef178c18aa |
children | 3a90f70dac73 |
files | api/Factories/Xml/WarFoundryXmlGameSystemFactory.cs api/Factories/Xml/WarFoundryXmlRaceFactory.cs |
diffstat | 2 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- 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<StatSlot> slots = new List<StatSlot>(); 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);
--- 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];