Mercurial > repos > IBDev-IBBoard.WarFoundry.API
comparison api/Factories/Xml/WarFoundryXmlGameSystemFactory.cs @ 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 | e6200220ece3 |
comparison
equal
deleted
inserted
replaced
52:64ef178c18aa | 53:1b35eed503ef |
---|---|
87 private SystemStats CreateSystemStatsFromElement(XmlElement elem) | 87 private SystemStats CreateSystemStatsFromElement(XmlElement elem) |
88 { | 88 { |
89 List<StatSlot> slots = new List<StatSlot>(); | 89 List<StatSlot> slots = new List<StatSlot>(); |
90 string id = elem.GetAttribute("id"); | 90 string id = elem.GetAttribute("id"); |
91 | 91 |
92 foreach (XmlElement slot in elem.ChildNodes) | 92 foreach (XmlElement slot in WarFoundryXmlFactoryUtils.SelectNodes(elem, "system:sysStat")) |
93 { | 93 { |
94 StatSlot statSlot = new StatSlot(slot.GetAttribute("name")); | 94 StatSlot statSlot = new StatSlot(slot.GetAttribute("name")); |
95 slots.Add(statSlot); | 95 slots.Add(statSlot); |
96 } | 96 } |
97 | 97 |