HTMLDocument.FixedNestedTag not handling broken cell tag

Topics: Developer Forum
Aug 6, 2007 at 5:48 PM
Hello,

I noticed today while searching for a parent for a cell, that it was returning the wrong parent node. In my research of the problem I discovered that in the HtmlDocument, the FixedNestedTag is not getting the correct ResetterNode from the FindResetterNodes function. Can anyone think of a way around this, or a fix? For clarity, I have an example below:

01 <table>
02 <tr>
03 <td class="cell1">
04 <table>
05 <tr>
06 <td class="cell2">Stuff</td>
07 </td> <!--Broken Cell Tag-->
08 <td class="LastCell">More Stuff</td>
09 </tr>
10 </table>
11 </td>
12 </tr>
13 </table>

Above we have a broken cell tag in line 07. When I search for the parent node for the cell in line 08, instead of returning the row node at line 05, it is returning the row node from line 02. I think this is cause in the HTMLDocument.FindResseterNode function, as it is trying to close the previous node with the same name that hasn't yet been closed. Therefore in that instance, since the cell node at line 06 is already closed, it looks to the cell node in line 03 and closes that.