title: HtmlAgilityPack example for changing links doesn't work. How do I accomplish this?
body: <p>The example on <a href="http://htmlagilitypack.codeplex.com/Wiki/View.aspx?title=Examples" rel="nofollow noreferrer">codeplex</a> is this :</p>
  
  <pre><code>HtmlDocument doc = new HtmlDocument();
   doc.Load("file.htm");
   foreach(HtmlNode link in doc.DocumentElement.SelectNodes("//a[@href"])
   {
      HtmlAttribute att = link["href"];
      att.Value = FixLink(att);
   }
   doc.Save("file.htm");
  </code></pre>
  
  <p>The first issue is HtmlDocument.<strong>DocumentElement</strong> does not exist!  What does exist is HtmlDocument.<strong>DocumentNode</strong> but even when I use that instead, I'm unable to access the href attribute as described. I get the following error:</p>
  
  <pre><code>Cannot apply indexing with [] to an expression of type 'HtmlAgilityPack.HtmlNode'
  </code></pre>
  
  <p>Here's the code I'm trying to compile when I get this error:</p>
  
  <pre><code>private static void ChangeUrls(ref HtmlDocument doc)
  {
      foreach(HtmlNode link in doc.DocumentNode.SelectNodes("//@href"))
      {
          HtmlAttribute attr = link["href"];
          attr.Value = Rewriter(attr.Value);
      }
  }
  </code></pre>
  
  <p><strong>UPDATE:</strong> I Just found that the example was never meant to work...And I've got a solution after reading the example code...I'll post my solution for other people like me to enjoy once completed.</p>