comparison api/Factories/Xml/WarFoundryXmlRaceFactory.cs @ 71:0303ac938fc5

Re #50 - Complete core loading of WarFoundry XML files * Fix XPath query to get a specific unit from a document
author IBBoard <dev@ibboard.co.uk>
date Sat, 25 Apr 2009 19:38:55 +0000
parents 780f3926abad
children 032b174fc17a
comparison
equal deleted inserted replaced
70:780f3926abad 71:0303ac938fc5
90 return cat; 90 return cat;
91 } 91 }
92 92
93 private UnitType GetUnitTypeFromDocument(XmlDocument doc, string id, Race parentRace) 93 private UnitType GetUnitTypeFromDocument(XmlDocument doc, string id, Race parentRace)
94 { 94 {
95 return GetUnitTypeForElement(WarFoundryXmlFactoryUtils.SelectSingleElement(doc, "/race:race/race:units/race:unit[id="+id+"]"), parentRace); 95 return GetUnitTypeForElement(WarFoundryXmlFactoryUtils.SelectSingleElement(doc, "/race:race/race:units/race:unit[@id='"+id+"']"), parentRace);
96 } 96 }
97 97
98 private UnitType GetUnitTypeForElement(XmlElement elem, Race parentRace) 98 private UnitType GetUnitTypeForElement(XmlElement elem, Race parentRace)
99 { 99 {
100 string id = elem.GetAttribute("id"); 100 string id = elem.GetAttribute("id");