running over DOM tree of not wellformed html - important



Hi All,
I really hope you an help me.

I got an html page that contains the following:

<table>
<tbody>
<tr>
<td></td>
<td id="1">
<form>...</form>
<td ="2"> ....this is the important one </td>
</td>
</tr>
</tbody>
</table>



As you can see there is a <td> inside another <td> (which is not ok, but
this iswhat we have).

When i run over the elements (in my BHO), when using

get_children() method on the <td id=1> element , i DO NOT get the <td id=2>
at all, only the other elements,so i cannot get to the internal TD...

On the other direction,
If i get the <td id=2> element (in mouseover for example), and try to
"get_parentelement()", which usually give me the correct parent, i now get
a <TR> element which is not defined in the page, for this <tr> i get a
<Tbody> parent element (which ,again, is not defined in the page), and then a
<table> element(which ,again, is not defined in the page). Only then, the
parent element of this table is the <td id=1> element.
Meaning, i got 3 levels in the hierarchy that were somehow implicitly
defined in the hierarchy. But only when going botton to top.

I will also say, that when i use "developenr toolbar", the hierarchy looks
as the page wae written, meaning : a <td> element inside a <td> element,
without any additions.

My questions/problems are:

1. I need a way to get the internal td , from the parent td...

I NEED to get the same hierarchy !! no matter if i read bottom-to-top
or top-to-bottom.

So, either i can get the hierarchy with the implicit levels , in both
directions,
OR, i get the hierarchy as i was written to the page, IN BOTH DIRECTIONS

2. Are ther eany other known problems such as this? that the DOM adds
implicit elements because a page isd not well formed?

3. and specifically for table: if tbody is not defined, will it be
implicitly added the same way?

Thanks

Noa

.



Relevant Pages

  • Re: [RFC][PATCH 1/2] memcg: res_counter hierarchy
    ... While several policy of hierarchy can be considered, ... create a child. ... prepare enough room in parent. ... One way to manage hierarchies other than via limits is to use shares (please see ...
    (Linux-Kernel)
  • [RFC][PATCH 1/2] memcg: res_counter hierarchy
    ... This patch tries to implements _simple_ 'hierarchy policy' in res_counter. ... dynamic hierarchy resource usage management in the kernel is not necessary ... create a child. ... prepare enough room in parent. ...
    (Linux-Kernel)
  • Re: SQL, related records (quotes)
    ... Let's say for the hierarchy itself we decide on ... child parent ... child B to reference for referential integrity and what meaning the ... possible with a vertex involving itself as a root node of a hierarchy. ...
    (comp.databases.theory)
  • Re: Hierarchy Sorting
    ... Each record has 3 fields to define its position in the hierarchy: ... Parent, Position. ... All level 1 IDs have a common Parent with a very high ID ... UPDATE tblOrg As T ...
    (microsoft.public.access.queries)
  • Re: Type 2 SCD thats also a Parent-Child
    ... The problem with an SCD Type II hierarchy is that members move ... view off of it that allows parent nodes to be directly connected to ... Type 2 for the parent-child relationships: composite portfolios exist ... aggregation for a parent-child dimension in AS 2000? ...
    (microsoft.public.sqlserver.olap)