Note that there are some explanatory texts on larger screens.

plurals
  1. POIteration through the HtmlDocument.All collection stops at the referenced stylesheet?
    primarykey
    data
    text
    <p>Since "bug in .NET" is often not the real cause of a problem, I wonder if I'm missing something here.</p> <p>What I'm doing feels pretty simple. I'm iterating through the elements in a <code>HtmlDocument</code> called <code>doc</code> like this:</p> <pre><code>System.Diagnostics.Debug.WriteLine("*** " + doc.Url + " ***"); foreach (HtmlElement field in doc.All) System.Diagnostics.Debug.WriteLine(string.Format("Tag = {0}, ID = {1} ", field.TagName, field.Id)); </code></pre> <p>I then discovered the debug window output was this:</p> <pre><code>Tag = !, ID = Tag = HTML, ID = Tag = HEAD, ID = Tag = TITLE, ID = Tag = LINK, ID = </code></pre> <p>... when the actual HTML document looks like this:</p> <pre><code>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;Protocol&lt;/title&gt; &lt;link rel="Stylesheet" type="text/css" media="all" href="ProtocolStyle.css"&gt; &lt;/head&gt; &lt;body onselectstart="return false"&gt; &lt;table&gt; &lt;!-- Misc. table elements and cell values --&gt; &lt;/table&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Commenting out the <code>LINK</code> tag solves the issue for me, and the document is completely parsed. The <code>ProtocolStyle.css</code> file exist on disk and is loaded properly, if that would matter. Is this a bug in .NET 3.5 SP1, or what? For being such a web-oriented framework, I find it hard to believe there would be such a major bug in it.</p> <p><strong>Update:</strong> By the way, this iteration was done in the WebBrowser control's Navigated event.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload