private void AddCategory(long?parent_id, XmlElement el) { string category_name = el.GetAttribute("name"); // string.Format("{0}.{1}", parent_name, el.GetAttribute("name")); string is_sealed_txt = el.GetAttribute("sealed"); bool is_sealed = (is_sealed_txt != ""); long category_id = dictionaryDBHelper_import.AddCategory(parent_id, category_name, is_sealed); foreach (XmlNode xml_category in el.SelectNodes("category")) { AddCategory(category_id, (XmlElement)xml_category); } /* * foreach (XmlElement xml_category in el.GetElementsByTagName("category")) * { * AddCategory(category_id, xml_category); * }*/ foreach (XmlNode xml_question in el.SelectNodes("question")) { AddQuestion(category_id, (XmlElement)xml_question); } /*foreach (XmlElement xml_question in el.GetElementsByTagName("question")) * { * AddQuestion(category_id, xml_question); * }*/ }