예제 #1
0
 public static void SetInnerHtml(this XElement element, string html)
 {
     if (element == null || html == null)
     {
         throw new ArgumentNullException("element" + " | " + "html");
     }
     element.RemoveAll();
     var tmpElement = new SgmlDomFactory().BuildDocument(html);
     if (tmpElement.Root == null)
     {
         return;
     }
     foreach (var node in tmpElement.Root.Nodes())
     {
         element.Add(node);
     }
 }
예제 #2
0
using System;