2013-02-19 3 views
0

아래 방법을 사용하여 빈 노드를 제거하려고합니다. 그러나 나는 말을HTMLAgilityPack.HtmlNode에 제거 정의가 없습니다

containerNode.Remove(); 

에 오류 얻을 "HTMLAgilityPack.HtmlNode 제거에 대한 정의를 포함하지 않습니다 ....". 'HTMLAgilityPack 사용'이외의 HTMLAgilityPack의 Remove 메소드를 사용하려면 무엇을 참조해야합니까? 나는 그 이하와 같은 emtpy 노드를 떠나는 사용하고 내 방법 중 하나에서

static void RemoveEmptyNodes(HtmlNode containerNode) 
    { 
     if (containerNode.Attributes.Count == 0 && (containerNode.InnerText == null || containerNode.InnerText == string.Empty)) 
     { 
      containerNode.Remove(); 
     } 
     else 
     { 
      for (int i = containerNode.ChildNodes.Count - 1; i >= 0; i--) 
      { 
       RemoveEmptyNodes(containerNode.ChildNodes[i]); 
      } 
     } 
    } 

,, 등
myNode.RemoveAll(); 
myNode.RemoveAllChildren() 

어떻게 빈 노드를 제거 할 수 있습니까?

+0

버전 문제입니다. 최신 dll (1.4.6)을 다운로드하고 문제를 해결했습니다. 이제는 제거 방법이 있습니다 – San

+0

질문에 대답하고 문제가 해결되면이를 수락하십시오. 질문에 답을 두지 마십시오. – Alex

답변

0

버전 문제입니다. 최신 dll (1.4.6)을 다운로드하고 문제를 해결했습니다. 이제 제거 방법이 있습니다

관련 문제