我使用HtmlAgilityPack從字符串肌酸一個HTMLDocument的,喜歡XML:使用LINQ與Htmlagilitypack
HtmlDocument updoc = new HtmlDocument();
updoc.load(stringContents);
現在我想插入HtmlNodes作爲的XElement的孩子。我想:
XDocument xdoc = XDocument.load(path);
XElement body = xdoc.Descendants(ns + "body").Single();
body.Add(updoc.GetElementbyId("h"));
body.Add(updoc.GetElementbyId("m"));
body.Add(updoc.GetElementbyId("f"));
,但結果只會對象名稱(HtmlNodeAgilityPack,..),沒有工作。基本上我正在嘗試將HtmlAgilityPack和linq結合使用到xml。這可能嗎 ?