public Dictionary <string, IEnumerable <string> > Map(string tableName) { var results = new Dictionary <string, IEnumerable <string> >(); var filename = string.Format("{0}.xml", tableName); var xmlDocument = new XmlDocument(); using (var stream = streamLoader.LoadFor(filename)) xmlDocument.Load(stream); foreach (XmlNode node in xmlDocument.DocumentElement.ChildNodes) { var name = node.SelectSingleNode("name").InnerText; var attributes = GetAttributesFrom(node); results.Add(name, attributes); } return(results); }
public Dictionary <int, string> Map(string tableName) { var table = new Dictionary <int, string>(); var filename = string.Format("{0}.xml", tableName); var xmlDocument = new XmlDocument(); using (var stream = streamLoader.LoadFor(filename)) xmlDocument.Load(stream); foreach (XmlNode node in xmlDocument.DocumentElement.ChildNodes) { var lower = Convert.ToInt32(node.SelectSingleNode("lower").InnerText); var upper = Convert.ToInt32(node.SelectSingleNode("upper").InnerText); var content = node.SelectSingleNode("content").InnerText; for (var i = lower; i <= upper; i++) { table.Add(i, content); } } return(table); }