private AdferoCategoryList ListCategoriesFromXmlString(string xml) { XmlDocument doc = new XmlDocument(); doc.LoadXml(xml); int totalCount = int.Parse(doc.SelectSingleNode("//categories").Attributes["totalCount"].Value); AdferoCategoryList categoryItems = new AdferoCategoryList(); categoryItems.TotalCount = totalCount; foreach (XmlNode n in doc.SelectNodes("//categories/category")) { foreach (XmlNode na in n.SelectNodes("id")) { AdferoCategoryListItem category = new AdferoCategoryListItem(); category.Id = int.Parse(na.InnerText); categoryItems.Items.Add(category); } } return(categoryItems); }
private AdferoCategoryList ListCategoriesFromXmlString(string xml) { XmlDocument doc = new XmlDocument(); doc.LoadXml(xml); int totalCount = int.Parse(doc.SelectSingleNode("//categories").Attributes["totalCount"].Value); AdferoCategoryList categoryItems = new AdferoCategoryList(); categoryItems.TotalCount = totalCount; foreach (XmlNode n in doc.SelectNodes("//categories/category")) { foreach (XmlNode na in n.SelectNodes("id")) { AdferoCategoryListItem category = new AdferoCategoryListItem(); category.Id = int.Parse(na.InnerText); categoryItems.Items.Add(category); } } return categoryItems; }