protected string GetChildTags(CQ csq) { string tags = ""; csq.Each(delegate(IDomObject e) { tags += (tags == "" ? "" : ",") + "'" + e.NodeName + "'"; }); return tags; }
/// <summary> /// DOM(td)から、tdとその子要素のinnerTestを取得してデコード. /// </summary> /// <param name="ele"></param> /// <returns></returns> public String SanitizeString(IDomObject ele) { // tdの文字列. String str = ele.InnerText; // 子要素の文字列. CQ tdCQ = new CQ(ele); CQ tdAll = new CQ("*", tdCQ); tdAll.Each((int index, IDomObject e) => { if (tdAll[index].InnerText is String) { str += tdAll[index].InnerText; } }); // デコード. str = WebUtility.HtmlDecode(str); // 整形. str = str.Replace(",", ""); // System.Windows.MessageBox.Show(str); return str; }