private Dictionary <string, string> AddToDictionary(Dictionary <string, string> inpDictionary, string xpath) { if (XMLDoc != null) { var nods = XMLDoc.SelectNodes(xpath); if (nods != null) { foreach (XmlNode nod in nods) { if (inpDictionary.ContainsKey(nod.Name)) { inpDictionary[nod.Name] = nod.InnerText; // overwrite same name node } else { inpDictionary.Add(nod.Name, nod.InnerText); } if (nod.Attributes != null && nod.Attributes["selectedtext"] != null) { var textname = nod.Name + "text"; if (inpDictionary.ContainsKey(textname)) { inpDictionary[textname] = nod.Attributes["selectedtext"].Value; // overwrite same name node } else { inpDictionary.Add(textname, nod.Attributes["selectedtext"].Value); } } } } } return(inpDictionary); }
public List <String> GetXrefList(string nodeName) { var strList = new List <String>(); var nodList = XMLDoc.SelectNodes("genxml/" + nodeName + "/id"); foreach (XmlNode nod in nodList) { strList.Add(nod.InnerText); } return(strList); }