running over DOM tree of not wellformed html - important
- From: Noa <Noa@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 13 Jul 2006 04:18:01 -0700
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
.
- Prev by Date: Re: BHO and Security Settings
- Next by Date: Re: How to identify an image from a corresponding "Map" element?
- Previous by thread: Trying to populate my db after filter
- Next by thread: Re:webbrowser2 hangs when applet opens a window
- Index(es):
Relevant Pages
|
|